From e071f74ea1c3dc5a55c521b2995a8662da630a4c Mon Sep 17 00:00:00 2001 From: lianahus Date: Wed, 15 Feb 2023 12:25:25 +0100 Subject: [PATCH 01/50] added Delete All for workspaces --- .../src/app/tabs/locales/en/filePanel.json | 2 ++ .../src/app/tabs/locales/zh/filePanel.json | 2 ++ .../workspace/src/lib/actions/workspace.ts | 9 ++++- .../lib/components/workspace-hamburger.tsx | 33 +++++++++++++++++++ .../workspace/src/lib/contexts/index.ts | 1 + .../src/lib/providers/FileSystemProvider.tsx | 7 +++- .../workspace/src/lib/remix-ui-workspace.tsx | 21 +++++++++++- 7 files changed, 72 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/locales/en/filePanel.json b/apps/remix-ide/src/app/tabs/locales/en/filePanel.json index a063529231..6148b791ae 100644 --- a/apps/remix-ide/src/app/tabs/locales/en/filePanel.json +++ b/apps/remix-ide/src/app/tabs/locales/en/filePanel.json @@ -9,6 +9,8 @@ "filePanel.workspace.rename": "Rename Workspace", "filePanel.workspace.delete": "Delete Workspace", "filePanel.workspace.deleteConfirm": "Are you sure to delete the current workspace?", + "filePanel.workspace.deleteAll": "Delete All Workspaces", + "filePanel.workspace.deleteAllConfirm": "Are you absolutely sure you want to delete all your workspace?", "filePanel.workspace.name": "Workspace name", "filePanel.workspace.chooseTemplate": "Choose a template", "filePanel.workspace.download": "Download Workspace", diff --git a/apps/remix-ide/src/app/tabs/locales/zh/filePanel.json b/apps/remix-ide/src/app/tabs/locales/zh/filePanel.json index a0a1e1b0c7..467a556792 100644 --- a/apps/remix-ide/src/app/tabs/locales/zh/filePanel.json +++ b/apps/remix-ide/src/app/tabs/locales/zh/filePanel.json @@ -9,6 +9,8 @@ "filePanel.workspace.rename": "重命名工作空间", "filePanel.workspace.delete": "删除工作空间", "filePanel.workspace.deleteConfirm": "确定要删除当前工作空间?", + "filePanel.workspace.deleteAll": "Delete All Workspaces", + "filePanel.workspace.deleteAllConfirm": "Are you absolutely sure you want to delete all your workspace?", "filePanel.workspace.name": "工作空间名称", "filePanel.workspace.chooseTemplate": "选择一个工作空间模板", "filePanel.workspace.download": "下载工作空间", diff --git a/libs/remix-ui/workspace/src/lib/actions/workspace.ts b/libs/remix-ui/workspace/src/lib/actions/workspace.ts index 8b3b1f14e6..f25827373c 100644 --- a/libs/remix-ui/workspace/src/lib/actions/workspace.ts +++ b/libs/remix-ui/workspace/src/lib/actions/workspace.ts @@ -311,6 +311,14 @@ export const deleteWorkspace = async (workspaceName: string, cb?: (err: Error, r cb && cb(null, workspaceName) } +export const deleteAllWorkspaces = async () => { + await (await getWorkspaces()).map(async workspace => { + await deleteWorkspaceFromProvider(workspace.name) + await dispatch(setDeleteWorkspace(workspace.name)) + plugin.workspaceDeleted(workspace.name) + }) +} + const deleteWorkspaceFromProvider = async (workspaceName: string) => { const workspacesPath = plugin.fileProviders.workspace.workspacesPath @@ -450,7 +458,6 @@ export const cloneRepository = async (url: string) => { if (!isActive) await plugin.call('manager', 'activatePlugin', 'dgit') await fetchWorkspaceDirectory(ROOT_PATH) const workspacesPath = plugin.fileProviders.workspace.workspacesPath - console.log('go in to promise') const branches = await getGitRepoBranches(workspacesPath + '/' + repoName) dispatch(setCurrentWorkspaceBranches(branches)) diff --git a/libs/remix-ui/workspace/src/lib/components/workspace-hamburger.tsx b/libs/remix-ui/workspace/src/lib/components/workspace-hamburger.tsx index 02e9989aed..083c8b13ee 100644 --- a/libs/remix-ui/workspace/src/lib/components/workspace-hamburger.tsx +++ b/libs/remix-ui/workspace/src/lib/components/workspace-hamburger.tsx @@ -8,6 +8,7 @@ const _paq = window._paq = window._paq || [] export interface HamburgerMenuProps { createWorkspace: () => void, deleteCurrentWorkspace: () => void, + deleteAllWorkspaces: () => void, renameCurrentWorkspace: () => void, cloneGitRepository: () => void, downloadWorkspaces: () => void, @@ -89,6 +90,38 @@ export function HamburgerMenu (props: HamburgerMenuProps) { + + } + > +
{ + props.deleteAllWorkspaces() + _paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspaceDeleteAll']) + props.hideIconsMenu(!showIconsMenu) + }} + key={`workspacesDelete-fe-ws`} + > + + +
+
+
Promise, dispatchRenameWorkspace: (oldName: string, workspaceName: string) => Promise, dispatchDeleteWorkspace: (workspaceName: string) => Promise, + dispatchDeleteAllWorkspaces: () => Promise, dispatchPublishToGist: (path?: string, type?: string) => Promise, dispatchUploadFile: (target?: SyntheticEvent, targetFolder?: string) => Promise, dispatchCreateNewFile: (path: string, rootDir: string) => Promise, diff --git a/libs/remix-ui/workspace/src/lib/providers/FileSystemProvider.tsx b/libs/remix-ui/workspace/src/lib/providers/FileSystemProvider.tsx index 2921ebe308..887a0f1afd 100644 --- a/libs/remix-ui/workspace/src/lib/providers/FileSystemProvider.tsx +++ b/libs/remix-ui/workspace/src/lib/providers/FileSystemProvider.tsx @@ -5,7 +5,7 @@ import { Toaster } from '@remix-ui/toaster' // eslint-disable-line // eslint-disable-next-line @typescript-eslint/no-unused-vars import { FileSystemContext } from '../contexts' import { browserReducer, browserInitialState } from '../reducers/workspace' -import { initWorkspace, fetchDirectory, removeInputField, deleteWorkspace, clearPopUp, publishToGist, createNewFile, setFocusElement, createNewFolder, +import { initWorkspace, fetchDirectory, removeInputField, deleteWorkspace, deleteAllWorkspaces, clearPopUp, publishToGist, createNewFile, setFocusElement, createNewFolder, deletePath, renamePath, downloadPath, copyFile, copyFolder, runScript, emitContextMenuEvent, handleClickFile, handleExpandPath, addInputField, createWorkspace, fetchWorkspaceDirectory, renameWorkspace, switchToWorkspace, uploadFile, handleDownloadFiles, restoreBackupZip, cloneRepository, moveFile, moveFolder, showAllBranches, switchBranch, createNewBranch, checkoutRemoteBranch, createSolidityGithubAction, createTsSolGithubAction, createSlitherGithubAction @@ -67,6 +67,10 @@ export const FileSystemProvider = (props: WorkspaceProps) => { await deleteWorkspace(workspaceName) } + const dispatchDeleteAllWorkspaces = async () => { + await deleteAllWorkspaces() + } + const dispatchPublishToGist = async (path?: string, type?: string) => { await publishToGist(path, type) } @@ -258,6 +262,7 @@ export const FileSystemProvider = (props: WorkspaceProps) => { dispatchSwitchToWorkspace, dispatchRenameWorkspace, dispatchDeleteWorkspace, + dispatchDeleteAllWorkspaces, dispatchPublishToGist, dispatchUploadFile, dispatchCreateNewFile, diff --git a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx index 07c1b8ca85..4a1f8fdd83 100644 --- a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx +++ b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx @@ -90,6 +90,16 @@ export function Workspace () { ) } + const deleteAllWorkspaces = () => { + global.modal( + intl.formatMessage({ id: 'filePanel.workspace.deleteAll' }), + intl.formatMessage({ id: 'filePanel.workspace.deleteAllConfirm' }), + intl.formatMessage({ id: 'filePanel.ok' }), + onFinishDeleteAllWorkspaces, + '' + ) + } + const cloneGitRepository = () => { global.modal( intl.formatMessage({ id: 'filePanel.workspace.clone' }), @@ -175,7 +185,15 @@ export function Workspace () { console.error(e) } } - /** ** ****/ + + const onFinishDeleteAllWorkspaces = async () => { + try { + await global.dispatchDeleteAllWorkspaces() + } catch (e) { + global.modal(intl.formatMessage({ id: 'filePanel.workspace.deleteAll' }), e.message, intl.formatMessage({ id: 'filePanel.ok' }), () => {}, '') + console.error(e) + } + } const resetFocus = () => { global.dispatchSetFocusElement([{ key: '', type: 'folder' }]) @@ -433,6 +451,7 @@ export function Workspace () { Date: Wed, 15 Feb 2023 16:24:29 +0100 Subject: [PATCH 02/50] fixing data-id --- .../remix-ide-e2e/src/tests/workspace.test.ts | 2 +- .../src/tests/workspace_git.test.ts | 22 +++++++++---------- .../lib/components/workspace-hamburger.tsx | 16 +++++++------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/workspace.test.ts b/apps/remix-ide-e2e/src/tests/workspace.test.ts index 633b387365..41a3aa531a 100644 --- a/apps/remix-ide-e2e/src/tests/workspace.test.ts +++ b/apps/remix-ide-e2e/src/tests/workspace.test.ts @@ -415,7 +415,7 @@ module.exports = { }) .click('//*[@id="workspacesMenuDropdown"]/span/i') .waitForElementVisible('//*[@id="workspacesMenuDropdown"]/div/ul') - .click('//*[@id="workspacesMenuDropdown"]/div/ul/a[3]') // rename workspace_name + .click('//*[@id="workspacesMenuDropdown"]/div/ul/a[4]') // rename workspace_name .useCss() .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]') .waitForElementVisible('*[data-id="modalDialogCustomPromptTextRename"]') diff --git a/apps/remix-ide-e2e/src/tests/workspace_git.test.ts b/apps/remix-ide-e2e/src/tests/workspace_git.test.ts index e2293f4153..7f09d2cca5 100644 --- a/apps/remix-ide-e2e/src/tests/workspace_git.test.ts +++ b/apps/remix-ide-e2e/src/tests/workspace_git.test.ts @@ -68,8 +68,8 @@ module.exports = { .clickLaunchIcon('filePanel') .useXpath() .click('//*[@id="workspacesMenuDropdown"]/span/i') - .waitForElementVisible('//*[@id="workspacesMenuDropdown"]/div/ul/a[5]') - .click('//*[@id="workspacesMenuDropdown"]/div/ul/a[5]') + .waitForElementVisible('//*[@id="workspacesMenuDropdown"]/div/ul/a[6]') + .click('//*[@id="workspacesMenuDropdown"]/div/ul/a[6]') .useCss() .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') .click('[data-id="fileSystemModalDialogModalBody-react"]') @@ -95,8 +95,8 @@ module.exports = { browser .useXpath() .click('//*[@id="workspacesMenuDropdown"]/span/i') - .waitForElementVisible('//*[@id="workspacesMenuDropdown"]/div/ul/a[5]') - .click('//*[@id="workspacesMenuDropdown"]/div/ul/a[5]') + .waitForElementVisible('//*[@id="workspacesMenuDropdown"]/div/ul/a[6]') + .click('//*[@id="workspacesMenuDropdown"]/div/ul/a[6]') .useCss() .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') .click('[data-id="fileSystemModalDialogModalBody-react"]') @@ -107,8 +107,8 @@ module.exports = { .waitForElementContainsText('[data-id="workspacesSelect"]', 'awesome-remix1') .useXpath() .click('//*[@id="workspacesMenuDropdown"]/span/i') - .waitForElementVisible('//*[@id="workspacesMenuDropdown"]/div/ul/a[5]') - .click('//*[@id="workspacesMenuDropdown"]/div/ul/a[5]') + .waitForElementVisible('//*[@id="workspacesMenuDropdown"]/div/ul/a[6]') + .click('//*[@id="workspacesMenuDropdown"]/div/ul/a[6]') .useCss() .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') .click('[data-id="fileSystemModalDialogModalBody-react"]') @@ -119,7 +119,7 @@ module.exports = { .waitForElementContainsText('[data-id="workspacesSelect"]', 'awesome-remix2') .useXpath() .click('//*[@id="workspacesMenuDropdown"]/span/i') - .waitForElementVisible('//*[@id="workspacesMenuDropdown"]/div/ul/a[5]') + .waitForElementVisible('//*[@id="workspacesMenuDropdown"]/div/ul/a[6]') .useCss() .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') .click('[data-id="fileSystemModalDialogModalBody-react"]') @@ -142,8 +142,8 @@ module.exports = { locateStrategy: 'xpath', }) .click('//*[@id="workspacesMenuDropdown"]/span/i') - .waitForElementVisible('//*[@id="workspacesMenuDropdown"]/div/ul/a[5]') - .click('//*[@id="workspacesMenuDropdown"]/div/ul/a[5]') + .waitForElementVisible('//*[@id="workspacesMenuDropdown"]/div/ul/a[6]') + .click('//*[@id="workspacesMenuDropdown"]/div/ul/a[6]') .useCss() .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') .click('[data-id="fileSystemModalDialogModalBody-react"]') @@ -165,8 +165,8 @@ module.exports = { .waitForElementNotVisible('[data-id="workspaceGitPanel"]') .useXpath() .click('//*[@id="workspacesMenuDropdown"]/span/i') - .waitForElementVisible('//*[@id="workspacesMenuDropdown"]/div/ul/a[5]') - .click('//*[@id="workspacesMenuDropdown"]/div/ul/a[5]') + .waitForElementVisible('//*[@id="workspacesMenuDropdown"]/div/ul/a[6]') + .click('//*[@id="workspacesMenuDropdown"]/div/ul/a[6]') .useCss() .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') .click('[data-id="fileSystemModalDialogModalBody-react"]') diff --git a/libs/remix-ui/workspace/src/lib/components/workspace-hamburger.tsx b/libs/remix-ui/workspace/src/lib/components/workspace-hamburger.tsx index 083c8b13ee..b0976a49f2 100644 --- a/libs/remix-ui/workspace/src/lib/components/workspace-hamburger.tsx +++ b/libs/remix-ui/workspace/src/lib/components/workspace-hamburger.tsx @@ -98,24 +98,24 @@ export function HamburgerMenu (props: HamburgerMenuProps) { tooltipText={} >
{ props.deleteAllWorkspaces() _paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspaceDeleteAll']) props.hideIconsMenu(!showIconsMenu) }} - key={`workspacesDelete-fe-ws`} + key={`workspacesDeleteAll-fe-ws`} > @@ -152,7 +152,7 @@ export function HamburgerMenu (props: HamburgerMenuProps) {
- + - + - + Date: Thu, 16 Feb 2023 12:30:50 +0100 Subject: [PATCH 03/50] mburger refactoring --- .../workspace/src/lib/actions/workspace.ts | 1 - .../lib/components/workspace-hamburger.tsx | 376 +++--------------- 2 files changed, 49 insertions(+), 328 deletions(-) diff --git a/libs/remix-ui/workspace/src/lib/actions/workspace.ts b/libs/remix-ui/workspace/src/lib/actions/workspace.ts index f25827373c..a37759044e 100644 --- a/libs/remix-ui/workspace/src/lib/actions/workspace.ts +++ b/libs/remix-ui/workspace/src/lib/actions/workspace.ts @@ -488,7 +488,6 @@ export const cloneRepository = async (url: string) => { } } - export const checkGit = async () => { const isGitRepo = await plugin.fileManager.isGitRepo() dispatch(setCurrentWorkspaceIsGitRepo(isGitRepo)) diff --git a/libs/remix-ui/workspace/src/lib/components/workspace-hamburger.tsx b/libs/remix-ui/workspace/src/lib/components/workspace-hamburger.tsx index b0976a49f2..0dc1e37fc6 100644 --- a/libs/remix-ui/workspace/src/lib/components/workspace-hamburger.tsx +++ b/libs/remix-ui/workspace/src/lib/components/workspace-hamburger.tsx @@ -1,9 +1,6 @@ import React from 'react' -import { CustomTooltip } from '@remix-ui/helper' import { Dropdown } from 'react-bootstrap' -import { FormattedMessage } from 'react-intl' - -const _paq = window._paq = window._paq || [] +import { HamburgerMenuItem } from './workspace-hamburger-item' export interface HamburgerMenuProps { createWorkspace: () => void, @@ -24,326 +21,51 @@ export interface HamburgerMenuProps { export function HamburgerMenu (props: HamburgerMenuProps) { const { showIconsMenu, hideWorkspaceOptions, hideLocalhostOptions } = props - return ( - <> - - } - > -
{ - props.createWorkspace() - _paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspaceCreate']) - props.hideIconsMenu(!showIconsMenu) - }} - key={`workspacesCreate-fe-ws`} - > - - -
-
-
- - } - > -
{ - props.deleteCurrentWorkspace() - _paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspaceDelete']) - props.hideIconsMenu(!showIconsMenu) - }} - key={`workspacesDelete-fe-ws`} - > - - -
-
-
- - } - > -
{ - props.deleteAllWorkspaces() - _paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspaceDeleteAll']) - props.hideIconsMenu(!showIconsMenu) - }} - key={`workspacesDeleteAll-fe-ws`} - > - - -
-
-
- - } - > -
{ - props.renameCurrentWorkspace() - _paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspaceRename']) - props.hideIconsMenu(!showIconsMenu) - }} - data-id='workspaceRename' - key={`workspacesRename-fe-ws`} - > - - -
-
-
- - - } - > -
{ - props.cloneGitRepository() - _paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'cloneGitRepository']) - props.hideIconsMenu(!showIconsMenu) - }} - key={`cloneGitRepository-fe-ws`} - > - - -
-
-
- - - } - > -
{ - props.downloadWorkspaces() - _paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspacesDownload']) - props.hideIconsMenu(!showIconsMenu) - }} - key={`workspacesDownload-fe-ws`} - > - - -
-
-
- - } - > -
{ - props.restoreBackup() - _paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspacesRestore']) - props.hideIconsMenu(!showIconsMenu) - }} - key={`workspacesRestore-fe-ws`} - > - - -
-
-
- - - } - > -
{ - props.addGithubAction() - _paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'addSolidityTesting']) - props.hideIconsMenu(!showIconsMenu) - }} - > - - {} -
-
-
- - } - > -
{ - props.addTsSolTestGithubAction() - _paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'addTsSolTestingAction']) - props.hideIconsMenu(!showIconsMenu) - }} - > - - {} -
-
-
- - } - > -
{ - props.addSlitherGithubAction() - _paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'addSlitherAction']) - props.hideIconsMenu(!showIconsMenu) - }} - > - - {} -
-
-
- - ) - } + return ( + <> + { + props.createWorkspace() + props.hideIconsMenu(!showIconsMenu) + }}> + { + props.deleteCurrentWorkspace() + props.hideIconsMenu(!showIconsMenu) + }}> + { + props.deleteAllWorkspaces() + props.hideIconsMenu(!showIconsMenu) + }}> + { + props.renameCurrentWorkspace() + props.hideIconsMenu(!showIconsMenu) + }}> + + { + props.cloneGitRepository() + props.hideIconsMenu(!showIconsMenu) + }}> + + { + props.downloadWorkspaces() + props.hideIconsMenu(!showIconsMenu) + }}> + { + props.restoreBackup() + props.hideIconsMenu(!showIconsMenu) + }}> + + { + props.addGithubAction() + props.hideIconsMenu(!showIconsMenu) + }}> + { + props.addTsSolTestGithubAction() + props.hideIconsMenu(!showIconsMenu) + }}> + { + props.addSlitherGithubAction() + props.hideIconsMenu(!showIconsMenu) + }}> + + ) + } \ No newline at end of file From b7f3e227b9d5d352a5347c8e105cd112f7180729 Mon Sep 17 00:00:00 2001 From: lianahus Date: Thu, 16 Feb 2023 12:39:51 +0100 Subject: [PATCH 04/50] adding the component file --- .../components/workspace-hamburger-item.tsx | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 libs/remix-ui/workspace/src/lib/components/workspace-hamburger-item.tsx diff --git a/libs/remix-ui/workspace/src/lib/components/workspace-hamburger-item.tsx b/libs/remix-ui/workspace/src/lib/components/workspace-hamburger-item.tsx new file mode 100644 index 0000000000..dc80908b9a --- /dev/null +++ b/libs/remix-ui/workspace/src/lib/components/workspace-hamburger-item.tsx @@ -0,0 +1,51 @@ +import React from 'react' +import { CustomTooltip } from '@remix-ui/helper' +import { Dropdown } from 'react-bootstrap' +import { FormattedMessage } from 'react-intl' + +const _paq = window._paq = window._paq || [] + +export interface HamburgerMenuItemProps { + hideOption: boolean + kind: string + actionOnClick: () => void + fa: string +} + +export function HamburgerMenuItem (props: HamburgerMenuItemProps) { + const { hideOption } = props + const uid = 'workspace' + props.kind + return ( + <> + + } + > +
{ + props.actionOnClick() + _paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', {uid}]) + }} + > + + + + +
+
+
+ + ) + } From 2015846858baaf5ee600b57d90fdcbf9a488f23b Mon Sep 17 00:00:00 2001 From: lianahus Date: Thu, 16 Feb 2023 15:00:27 +0100 Subject: [PATCH 05/50] updated the warning msg e2e --- .../remix-ide-e2e/src/tests/workspace.test.ts | 2 +- .../src/tests/workspace_git.test.ts | 40 +++++++++---------- .../src/app/tabs/locales/en/filePanel.json | 2 +- .../src/app/tabs/locales/zh/filePanel.json | 2 +- .../src/lib/components/custom-dropdown.tsx | 4 +- 5 files changed, 24 insertions(+), 26 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/workspace.test.ts b/apps/remix-ide-e2e/src/tests/workspace.test.ts index 41a3aa531a..7cda455c74 100644 --- a/apps/remix-ide-e2e/src/tests/workspace.test.ts +++ b/apps/remix-ide-e2e/src/tests/workspace.test.ts @@ -410,7 +410,7 @@ module.exports = { browser .useXpath() .waitForElementPresent({ - selector: '//i[@data-icon="workspaceDropdownMenuIcon"]', + selector: '//i[@data-id="workspaceDropdownMenuIcon"]', locateStrategy: 'xpath', }) .click('//*[@id="workspacesMenuDropdown"]/span/i') diff --git a/apps/remix-ide-e2e/src/tests/workspace_git.test.ts b/apps/remix-ide-e2e/src/tests/workspace_git.test.ts index 7f09d2cca5..a60a3fb776 100644 --- a/apps/remix-ide-e2e/src/tests/workspace_git.test.ts +++ b/apps/remix-ide-e2e/src/tests/workspace_git.test.ts @@ -58,18 +58,16 @@ module.exports = { .waitForElementContainsText('[data-id="workspaceGitBranchesDropdown"]', 'main') }, - - - // CLONE REPOSITORY E2E START 'Should clone a repository #group2': function (browser: NightwatchBrowser) { browser .clickLaunchIcon('filePanel') .useXpath() - .click('//*[@id="workspacesMenuDropdown"]/span/i') - .waitForElementVisible('//*[@id="workspacesMenuDropdown"]/div/ul/a[6]') - .click('//*[@id="workspacesMenuDropdown"]/div/ul/a[6]') + .waitForElementVisible('[data-id="workspaceDropdownMenuIcon"]') + .click('[data-id="workspaceDropdownMenuIcon"]') + .waitForElementVisible('[data-id="initGitRepositoryLabel"]') + .click('[data-id="workspaceclone]"') .useCss() .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') .click('[data-id="fileSystemModalDialogModalBody-react"]') @@ -94,9 +92,9 @@ module.exports = { 'Should display non-clashing names for duplicate clone #group2': '' + function (browser: NightwatchBrowser) { browser .useXpath() - .click('//*[@id="workspacesMenuDropdown"]/span/i') - .waitForElementVisible('//*[@id="workspacesMenuDropdown"]/div/ul/a[6]') - .click('//*[@id="workspacesMenuDropdown"]/div/ul/a[6]') + .click('[data-id="workspaceDropdownMenuIcon"]') + .waitForElementVisible('[data-id="workspaceclone]"') + .click('[data-id="workspaceclone]"') .useCss() .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') .click('[data-id="fileSystemModalDialogModalBody-react"]') @@ -106,9 +104,9 @@ module.exports = { .pause(5000) .waitForElementContainsText('[data-id="workspacesSelect"]', 'awesome-remix1') .useXpath() - .click('//*[@id="workspacesMenuDropdown"]/span/i') - .waitForElementVisible('//*[@id="workspacesMenuDropdown"]/div/ul/a[6]') - .click('//*[@id="workspacesMenuDropdown"]/div/ul/a[6]') + .click('[data-id="workspaceDropdownMenuIcon"]') + .waitForElementVisible('[data-id="workspaceclone]"') + .click('[data-id="workspaceclone]"') .useCss() .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') .click('[data-id="fileSystemModalDialogModalBody-react"]') @@ -118,8 +116,8 @@ module.exports = { .pause(5000) .waitForElementContainsText('[data-id="workspacesSelect"]', 'awesome-remix2') .useXpath() - .click('//*[@id="workspacesMenuDropdown"]/span/i') - .waitForElementVisible('//*[@id="workspacesMenuDropdown"]/div/ul/a[6]') + .click('[data-id="workspaceDropdownMenuIcon"]') + .waitForElementVisible('[data-id="workspaceclone]"') .useCss() .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') .click('[data-id="fileSystemModalDialogModalBody-react"]') @@ -138,12 +136,12 @@ module.exports = { browser .useXpath() .waitForElementPresent({ - selector: '//i[@data-icon="workspaceDropdownMenuIcon"]', + selector: '[data-id="workspaceDropdownMenuIcon"]', locateStrategy: 'xpath', }) - .click('//*[@id="workspacesMenuDropdown"]/span/i') - .waitForElementVisible('//*[@id="workspacesMenuDropdown"]/div/ul/a[6]') - .click('//*[@id="workspacesMenuDropdown"]/div/ul/a[6]') + .click('[data-id="workspaceDropdownMenuIcon"]') + .waitForElementVisible('[data-id="workspaceclone]"') + .click('[data-id="workspaceclone]"') .useCss() .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') .click('[data-id="fileSystemModalDialogModalBody-react"]') @@ -164,9 +162,9 @@ module.exports = { .clickLaunchIcon('filePanel') .waitForElementNotVisible('[data-id="workspaceGitPanel"]') .useXpath() - .click('//*[@id="workspacesMenuDropdown"]/span/i') - .waitForElementVisible('//*[@id="workspacesMenuDropdown"]/div/ul/a[6]') - .click('//*[@id="workspacesMenuDropdown"]/div/ul/a[6]') + .click('[data-id="workspaceDropdownMenuIcon"]') + .waitForElementVisible('[data-id="workspaceclone]"') + .click('[data-id="workspaceclone]"') .useCss() .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') .click('[data-id="fileSystemModalDialogModalBody-react"]') diff --git a/apps/remix-ide/src/app/tabs/locales/en/filePanel.json b/apps/remix-ide/src/app/tabs/locales/en/filePanel.json index 6148b791ae..df659f9820 100644 --- a/apps/remix-ide/src/app/tabs/locales/en/filePanel.json +++ b/apps/remix-ide/src/app/tabs/locales/en/filePanel.json @@ -10,7 +10,7 @@ "filePanel.workspace.delete": "Delete Workspace", "filePanel.workspace.deleteConfirm": "Are you sure to delete the current workspace?", "filePanel.workspace.deleteAll": "Delete All Workspaces", - "filePanel.workspace.deleteAllConfirm": "Are you absolutely sure you want to delete all your workspace?", + "filePanel.workspace.deleteAllConfirm": "Are you absolutely sure you want to delete all your workspaces? Deleted workspaces can not be restored in any manner.", "filePanel.workspace.name": "Workspace name", "filePanel.workspace.chooseTemplate": "Choose a template", "filePanel.workspace.download": "Download Workspace", diff --git a/apps/remix-ide/src/app/tabs/locales/zh/filePanel.json b/apps/remix-ide/src/app/tabs/locales/zh/filePanel.json index 467a556792..94129f0d31 100644 --- a/apps/remix-ide/src/app/tabs/locales/zh/filePanel.json +++ b/apps/remix-ide/src/app/tabs/locales/zh/filePanel.json @@ -10,7 +10,7 @@ "filePanel.workspace.delete": "删除工作空间", "filePanel.workspace.deleteConfirm": "确定要删除当前工作空间?", "filePanel.workspace.deleteAll": "Delete All Workspaces", - "filePanel.workspace.deleteAllConfirm": "Are you absolutely sure you want to delete all your workspace?", + "filePanel.workspace.deleteAllConfirm": "Are you absolutely sure you want to delete all your workspaces? Deleted workspaces can not be restored in any manner.", "filePanel.workspace.name": "工作空间名称", "filePanel.workspace.chooseTemplate": "选择一个工作空间模板", "filePanel.workspace.download": "下载工作空间", diff --git a/libs/remix-ui/helper/src/lib/components/custom-dropdown.tsx b/libs/remix-ui/helper/src/lib/components/custom-dropdown.tsx index 04d31c4839..5322b4c61a 100644 --- a/libs/remix-ui/helper/src/lib/components/custom-dropdown.tsx +++ b/libs/remix-ui/helper/src/lib/components/custom-dropdown.tsx @@ -30,7 +30,7 @@ export const CustomIconsToggle = React.forwardRef(({ onClick, icon, className = className={`${className.replace('dropdown-toggle', '')} mb-0 pb-0 d-flex justify-content-end align-items-end remixuimenuicon_shadow fs-3`} data-id="workspaceMenuDropdown" > - { icon && } + { icon && } )) @@ -48,7 +48,7 @@ export const CustomMenu = React.forwardRef( >
    { - children + children }
From 97e318bfbe943d38e709e255feba919ec0dc7d90 Mon Sep 17 00:00:00 2001 From: lianahus Date: Mon, 20 Feb 2023 12:04:51 +0100 Subject: [PATCH 06/50] fixing hover --- .../workspace/src/lib/css/remix-ui-workspace.css | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/libs/remix-ui/workspace/src/lib/css/remix-ui-workspace.css b/libs/remix-ui/workspace/src/lib/css/remix-ui-workspace.css index b52432b403..020c7807cc 100644 --- a/libs/remix-ui/workspace/src/lib/css/remix-ui-workspace.css +++ b/libs/remix-ui/workspace/src/lib/css/remix-ui-workspace.css @@ -115,21 +115,8 @@ min-width: 8rem; } - .remixui_menuhr{ - - } - - #workspacesMenuDropdown>div>ul>a:nth-child(6):hover { - background-color: rgba(0,0,0,0) - } - - #workspacesMenuDropdown>div>ul>a:nth-child(4):hover { - background-color: rgba(0, 0, 0, 0) - } - #workspacesMenuDropdown > div > ul > a:hover { background-color: var(--secondary); - /* border: 1px solid var(--secondary); */ border-radius: 2px; color: var(--text) } From e4769c6a9d0308c823fc1cb449c15cbac96b5bd3 Mon Sep 17 00:00:00 2001 From: lianahus Date: Mon, 20 Feb 2023 12:33:50 +0100 Subject: [PATCH 07/50] e2e --- .../src/tests/workspace_git.test.ts | 53 +++++++------------ 1 file changed, 19 insertions(+), 34 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/workspace_git.test.ts b/apps/remix-ide-e2e/src/tests/workspace_git.test.ts index a60a3fb776..fd2c261493 100644 --- a/apps/remix-ide-e2e/src/tests/workspace_git.test.ts +++ b/apps/remix-ide-e2e/src/tests/workspace_git.test.ts @@ -63,12 +63,10 @@ module.exports = { 'Should clone a repository #group2': function (browser: NightwatchBrowser) { browser .clickLaunchIcon('filePanel') - .useXpath() - .waitForElementVisible('[data-id="workspaceDropdownMenuIcon"]') - .click('[data-id="workspaceDropdownMenuIcon"]') - .waitForElementVisible('[data-id="initGitRepositoryLabel"]') - .click('[data-id="workspaceclone]"') - .useCss() + .waitForElementVisible('[data-id="workspaceMenuDropdown"]') + .click('[data-id="workspaceMenuDropdown"]') + .waitForElementVisible('[data-id="workspaceclone"]') + .click('[data-id="workspaceclone"]') .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') .click('[data-id="fileSystemModalDialogModalBody-react"]') .waitForElementVisible('[data-id="modalDialogCustomPromptTextClone"]') @@ -91,11 +89,9 @@ module.exports = { 'Should display non-clashing names for duplicate clone #group2': '' + function (browser: NightwatchBrowser) { browser - .useXpath() - .click('[data-id="workspaceDropdownMenuIcon"]') - .waitForElementVisible('[data-id="workspaceclone]"') - .click('[data-id="workspaceclone]"') - .useCss() + .click('[data-id="workspaceMenuDropdown"]') + .waitForElementVisible('[data-id="workspaceclone"]') + .click('[data-id="workspaceclone"]') .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') .click('[data-id="fileSystemModalDialogModalBody-react"]') .waitForElementVisible('[data-id="modalDialogCustomPromptTextClone"]') @@ -103,11 +99,9 @@ module.exports = { .click('[data-id="fileSystem-modal-footer-ok-react"]') .pause(5000) .waitForElementContainsText('[data-id="workspacesSelect"]', 'awesome-remix1') - .useXpath() - .click('[data-id="workspaceDropdownMenuIcon"]') - .waitForElementVisible('[data-id="workspaceclone]"') - .click('[data-id="workspaceclone]"') - .useCss() + .click('[data-id="workspaceMenuDropdown"]') + .waitForElementVisible('[data-id="workspaceclone"]') + .click('[data-id="workspaceclone"]') .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') .click('[data-id="fileSystemModalDialogModalBody-react"]') .waitForElementVisible('[data-id="modalDialogCustomPromptTextClone"]') @@ -115,10 +109,8 @@ module.exports = { .click('[data-id="fileSystem-modal-footer-ok-react"]') .pause(5000) .waitForElementContainsText('[data-id="workspacesSelect"]', 'awesome-remix2') - .useXpath() - .click('[data-id="workspaceDropdownMenuIcon"]') - .waitForElementVisible('[data-id="workspaceclone]"') - .useCss() + .click('[data-id="workspaceMenuDropdown"]') + .waitForElementVisible('[data-id="workspaceDropdownMenuIcon]"') .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') .click('[data-id="fileSystemModalDialogModalBody-react"]') .waitForElementVisible('[data-id="modalDialogCustomPromptTextClone"]') @@ -134,15 +126,10 @@ module.exports = { 'Should display error message in modal for failed clone #group2': function (browser: NightwatchBrowser) { browser - .useXpath() - .waitForElementPresent({ - selector: '[data-id="workspaceDropdownMenuIcon"]', - locateStrategy: 'xpath', - }) - .click('[data-id="workspaceDropdownMenuIcon"]') - .waitForElementVisible('[data-id="workspaceclone]"') - .click('[data-id="workspaceclone]"') - .useCss() + .waitForElementVisible('[data-id="workspaceDropdownMenuIcon"]') + .click('[data-id="workspaceMenuDropdown"]') + .waitForElementVisible('[data-id="workspaceclone"]') + .click('[data-id="workspaceclone"]') .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') .click('[data-id="fileSystemModalDialogModalBody-react"]') .waitForElementVisible('[data-id="modalDialogCustomPromptTextClone"]') @@ -161,11 +148,9 @@ module.exports = { browser .clickLaunchIcon('filePanel') .waitForElementNotVisible('[data-id="workspaceGitPanel"]') - .useXpath() - .click('[data-id="workspaceDropdownMenuIcon"]') - .waitForElementVisible('[data-id="workspaceclone]"') - .click('[data-id="workspaceclone]"') - .useCss() + .click('[data-id="workspaceMenuDropdown"]') + .waitForElementVisible('[data-id="workspaceclone"]') + .click('[data-id="workspaceclone"]') .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') .click('[data-id="fileSystemModalDialogModalBody-react"]') .waitForElementVisible('[data-id="modalDialogCustomPromptTextClone"]') From 54e18014cebc39ca6fdaa1601292074355561be5 Mon Sep 17 00:00:00 2001 From: lianahus Date: Wed, 22 Feb 2023 09:46:53 +0100 Subject: [PATCH 08/50] label changed for Backup --- apps/remix-ide/src/app/tabs/locales/en/filePanel.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/locales/en/filePanel.json b/apps/remix-ide/src/app/tabs/locales/en/filePanel.json index df659f9820..e8af327d89 100644 --- a/apps/remix-ide/src/app/tabs/locales/en/filePanel.json +++ b/apps/remix-ide/src/app/tabs/locales/en/filePanel.json @@ -13,8 +13,8 @@ "filePanel.workspace.deleteAllConfirm": "Are you absolutely sure you want to delete all your workspaces? Deleted workspaces can not be restored in any manner.", "filePanel.workspace.name": "Workspace name", "filePanel.workspace.chooseTemplate": "Choose a template", - "filePanel.workspace.download": "Download Workspace", - "filePanel.workspace.restore": "Restore Workspace Backup", + "filePanel.workspace.download": "Backup Workspaces", + "filePanel.workspace.restore": "Restore Workspaces from the Backup", "filePanel.workspace.clone": "Clone Git Repository", "filePanel.workspace.cloneMessage": "Please provide a valid git repository url.", "filePanel.workspace.enterGitUrl": "Enter git repository url", From 33b380a05e87642615696b5fc5ac24cef8bb4253 Mon Sep 17 00:00:00 2001 From: lianahus Date: Wed, 22 Feb 2023 09:52:58 +0100 Subject: [PATCH 09/50] changed the label in the Ws dropdown --- apps/remix-ide/src/app/tabs/locales/en/filePanel.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide/src/app/tabs/locales/en/filePanel.json b/apps/remix-ide/src/app/tabs/locales/en/filePanel.json index e8af327d89..fa9e3500c1 100644 --- a/apps/remix-ide/src/app/tabs/locales/en/filePanel.json +++ b/apps/remix-ide/src/app/tabs/locales/en/filePanel.json @@ -3,7 +3,7 @@ "filePanel.workspace": "WORKSPACES", "filePanel.create": "Create", "filePanel.clone": "Clone", - "filePanel.download": "Download", + "filePanel.download": "Backup", "filePanel.restore": "Restore", "filePanel.workspace.create": "Create Workspace", "filePanel.workspace.rename": "Rename Workspace", From b0086e8d06356d3d6caeab9bf68aca554ec10f8d Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 22 Feb 2023 08:37:23 +0100 Subject: [PATCH 10/50] Update solidityImport.test.ts fix test --- apps/remix-ide-e2e/src/tests/solidityImport.test.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/solidityImport.test.ts b/apps/remix-ide-e2e/src/tests/solidityImport.test.ts index 2b75395e2a..79272841cf 100644 --- a/apps/remix-ide-e2e/src/tests/solidityImport.test.ts +++ b/apps/remix-ide-e2e/src/tests/solidityImport.test.ts @@ -31,8 +31,7 @@ module.exports = { .isVisible({ selector: "//span[contains(.,'not found Untitled11')]", locateStrategy: 'xpath', - timeout: 120000, - suppressNotFoundErrors: true + timeout: 120000 }) }, From f44971834c9f0e5f9cfff6ac4d1956498a4e113d Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Wed, 22 Feb 2023 12:00:33 +0100 Subject: [PATCH 11/50] Fixed down stream update sync --- libs/remixd/src/services/remixdClient.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libs/remixd/src/services/remixdClient.ts b/libs/remixd/src/services/remixdClient.ts index a3f3d9dd8f..4718cfbcf1 100644 --- a/libs/remixd/src/services/remixdClient.ts +++ b/libs/remixd/src/services/remixdClient.ts @@ -5,12 +5,14 @@ import * as utils from '../utils' import * as chokidar from 'chokidar' import * as fs from 'fs-extra' import * as isbinaryfile from 'isbinaryfile' +import * as pathModule from 'path' export class RemixdClient extends PluginClient { methods: Array websocket: WS currentSharedFolder: string watcher: chokidar.FSWatcher + trackDownStreamUpdate: Record = {} constructor (private readOnly = false) { super() @@ -105,6 +107,7 @@ export class RemixdClient extends PluginClient { this.createDir({ path: args.path.substr(0, args.path.lastIndexOf('/')) }) } try { + this.trackDownStreamUpdate[path] = args.content fs.writeFile(path, args.content, 'utf8', (error: Error) => { if (error) { console.log(error) @@ -263,8 +266,9 @@ export class RemixdClient extends PluginClient { }) */ this.watcher.on('change', async (f: string) => { - const currentContent = await this.call('editor', 'getText' as any, f) - const newContent = fs.readFileSync(f) + const path = pathModule.resolve(f) + const currentContent = this.trackDownStreamUpdate[path] + const newContent = fs.readFileSync(f, 'utf-8') if (currentContent !== newContent && this.isLoaded) { this.emit('changed', utils.relativePath(f, this.currentSharedFolder)) } From 3da070e559909dff47794a8775f58990cdb1f4ae Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Wed, 22 Feb 2023 12:00:33 +0100 Subject: [PATCH 12/50] Remove external commit --- apps/remix-ide-e2e/src/tests/solidityImport.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/tests/solidityImport.test.ts b/apps/remix-ide-e2e/src/tests/solidityImport.test.ts index 79272841cf..2b75395e2a 100644 --- a/apps/remix-ide-e2e/src/tests/solidityImport.test.ts +++ b/apps/remix-ide-e2e/src/tests/solidityImport.test.ts @@ -31,7 +31,8 @@ module.exports = { .isVisible({ selector: "//span[contains(.,'not found Untitled11')]", locateStrategy: 'xpath', - timeout: 120000 + timeout: 120000, + suppressNotFoundErrors: true }) }, From d69bcaf379eb62a920c4fe1d0c8ae91b9c14d8d3 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Fri, 17 Feb 2023 13:36:06 +0100 Subject: [PATCH 13/50] Fixed upgrade bug --- libs/remix-core-plugin/src/types/contract.ts | 3 ++- .../remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/remix-core-plugin/src/types/contract.ts b/libs/remix-core-plugin/src/types/contract.ts index cccce84203..bf6d343038 100644 --- a/libs/remix-core-plugin/src/types/contract.ts +++ b/libs/remix-core-plugin/src/types/contract.ts @@ -20,7 +20,8 @@ export interface ContractData { getConstructorInterface: () => any, getConstructorInputs: () => any, isOverSizeLimit: () => boolean, - metadata: any + metadata: any, + contractName?: string } export interface ContractAST { diff --git a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx index 83fa37faea..6828170172 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx @@ -235,7 +235,7 @@ export function ContractDropdownUI (props: ContractDropdownProps) { } const isValidProxyUpgrade = (proxyAddress: string) => { - return props.isValidProxyUpgrade(proxyAddress, loadedContractData.name, loadedContractData.compiler.source, loadedContractData.compiler.data) + return props.isValidProxyUpgrade(proxyAddress, loadedContractData.contractName || loadedContractData.name, loadedContractData.compiler.source, loadedContractData.compiler.data) } const checkSumWarning = () => { From f992052cb6006330cade3682e1bc1428734ba74d Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Wed, 22 Feb 2023 09:43:25 +0100 Subject: [PATCH 14/50] Update proxy warning message and fixed console error --- libs/remix-ui/helper/src/lib/helper-components.tsx | 2 +- libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx | 1 + .../remix-ui/run-tab/src/lib/components/instanceContainerUI.tsx | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/remix-ui/helper/src/lib/helper-components.tsx b/libs/remix-ui/helper/src/lib/helper-components.tsx index 707538e707..789999e558 100644 --- a/libs/remix-ui/helper/src/lib/helper-components.tsx +++ b/libs/remix-ui/helper/src/lib/helper-components.tsx @@ -119,7 +119,7 @@ export const upgradeWithProxyMsg = () => ( export const unavailableProxyLayoutMsg = () => (
-

Previous contract implementation is NOT available for upgrade comparison.
A new storage layout will be saved for future upgrades.

+

The previous contract implementation is NOT available for an upgrade comparison
A new storage layout will be saved for future upgrades.

) diff --git a/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx index 0f0ea63b19..bf1c45e77c 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx @@ -537,6 +537,7 @@ export function ContractGUI (props: ContractGUIProps) { tooltipClasses="text-nowrap" tooltipId={`proxyAddressTooltip${index}`} tooltipText={'Deployed ' + shortenDate(deployment.date)} + key={index} > 0 ?
{ props.instances.instanceList.map((instance, index) => { return Date: Wed, 22 Feb 2023 14:07:11 +0100 Subject: [PATCH 15/50] remove plugin from the app manager list --- apps/remix-ide/src/remixAppManager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide/src/remixAppManager.js b/apps/remix-ide/src/remixAppManager.js index 2ca45b728f..db5e5370df 100644 --- a/apps/remix-ide/src/remixAppManager.js +++ b/apps/remix-ide/src/remixAppManager.js @@ -10,7 +10,7 @@ const requiredModules = [ // services + layout views + system views 'fileManager', 'contentImport', 'blockchain', 'web3Provider', 'scriptRunner', 'fetchAndCompile', 'mainPanel', 'hiddenPanel', 'sidePanel', 'menuicons', 'filePanel', 'terminal', 'settings', 'pluginManager', 'tabs', 'udapp', 'dGitProvider', 'solidity', 'solidity-logic', 'gistHandler', 'layout', 'notification', 'permissionhandler', 'walkthrough', 'storage', 'restorebackupzip', 'link-libraries', 'deploy-libraries', 'openzeppelin-proxy', - 'hardhat-provider', 'ganache-provider', 'foundry-provider', 'basic-http-provider', 'injected', 'injected-optimism-provider', 'injected-arbitrum-one-provider', + 'hardhat-provider', 'ganache-provider', 'foundry-provider', 'basic-http-provider', 'injected', 'injected-optimism-provider', 'injected-arbitrum-one-provider', 'vm-custom-fork', 'vm-goerli-fork', 'vm-mainnet-fork', 'vm-sepolia-fork', 'vm-merge', 'vm-london', 'vm-berlin', 'compileAndRun', 'search', 'recorder', 'fileDecorator', 'codeParser', 'codeFormatter', 'solidityumlgen', 'contractflattener'] // dependentModules shouldn't be manually activated (e.g hardhat is activated by remixd) From 8d30708c28c4c7267cbc0346e5160fdeff7ad215 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 22 Feb 2023 14:07:25 +0100 Subject: [PATCH 16/50] update label --- apps/remix-ide/src/app/tabs/locales/en/settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide/src/app/tabs/locales/en/settings.json b/apps/remix-ide/src/app/tabs/locales/en/settings.json index b952518159..18e8a12d12 100644 --- a/apps/remix-ide/src/app/tabs/locales/en/settings.json +++ b/apps/remix-ide/src/app/tabs/locales/en/settings.json @@ -3,7 +3,7 @@ "settings.reset": "Reset to Default settings", "settings.general": "General settings", "settings.generateContractMetadataText": "Generate contract metadata. Generate a JSON file in the contract folder. Allows to specify library addresses the contract depends on. If nothing is specified, Remix deploys libraries automatically.", - "settings.ethereunVMText": "Always use Javascript VM at load", + "settings.ethereunVMText": "Always use the Remix VM at load", "settings.wordWrapText": "Word wrap in editor", "settings.useAutoCompleteText": "Enable code completion in editor.", "settings.useShowGasInEditorText": "Display gas estimates in editor.", From ad8e191d21104103352ccc464f3d175d9ada0801 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 22 Feb 2023 14:07:41 +0100 Subject: [PATCH 17/50] reorder provider list and update naming --- apps/remix-ide/src/app/udapp/run-tab.js | 27 ++++++++++++++----------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/apps/remix-ide/src/app/udapp/run-tab.js b/apps/remix-ide/src/app/udapp/run-tab.js index 539089ff24..f833cc29e5 100644 --- a/apps/remix-ide/src/app/udapp/run-tab.js +++ b/apps/remix-ide/src/app/udapp/run-tab.js @@ -131,6 +131,12 @@ export class RunTab extends ViewPlugin { }) } + // basic injected + const displayNameInjected = `Injected Provider${(window && window.ethereum && !(window.ethereum.providers && !window.ethereum.selectedProvider)) ? + window.ethereum.isCoinbaseWallet || window.ethereum.selectedProvider?.isCoinbaseWallet ? ' - Coinbase' : + window.ethereum.isBraveWallet || window.ethereum.selectedProvider?.isBraveWallet ? ' - Brave' : + window.ethereum.isMetaMask || window.ethereum.selectedProvider?.isMetaMask ? ' - MetaMask' : '' : ''}` + await addProvider('injected', displayNameInjected, true, false) // VM const titleVM = 'Execution environment is local to Remix. Data is only saved to browser memory and will vanish upon reload.' await addProvider('vm-merge', 'Remix VM (Merge)', false, true, 'merge', 'settingsVMMergeMode', titleVM) @@ -142,20 +148,17 @@ export class RunTab extends ViewPlugin { await addProvider('vm-custom-fork', 'Remix VM - Custom fork', false, true, '', 'settingsVMCustomMode', titleVM) // external provider - await addProvider('hardhat-provider', 'Hardhat Provider', false, false) - await addProvider('ganache-provider', 'Ganache Provider', false, false) - await addProvider('foundry-provider', 'Foundry Provider', false, false) + await addProvider('basic-http-provider', 'Custom - External Http Provider', false, false) + await addProvider('hardhat-provider', 'Dev - Hardhat Provider', false, false) + await addProvider('ganache-provider', 'Dev - Ganache Provider', false, false) + await addProvider('foundry-provider', 'Dev - Foundry Provider', false, false) + + // injected provider + await addProvider('injected-optimism-provider', 'L2 - Optimism Provider', true, false) + await addProvider('injected-arbitrum-one-provider', 'L2 - Arbitrum One Provider', true, false) + await addProvider('walletconnect', 'Wallet Connect', false, false) - await addProvider('basic-http-provider', 'External Http Provider', false, false) - // injected provider - const displayNameInjected = `Injected Provider${(window && window.ethereum && !(window.ethereum.providers && !window.ethereum.selectedProvider)) ? - window.ethereum.isCoinbaseWallet || window.ethereum.selectedProvider?.isCoinbaseWallet ? ' - Coinbase' : - window.ethereum.isBraveWallet || window.ethereum.selectedProvider?.isBraveWallet ? ' - Brave' : - window.ethereum.isMetaMask || window.ethereum.selectedProvider?.isMetaMask ? ' - MetaMask' : '' : ''}` - await addProvider('injected', displayNameInjected, true, false) - await addProvider('injected-optimism-provider', 'Optimism Provider', true, false) - await addProvider('injected-arbitrum-one-provider', 'Arbitrum One Provider', true, false) } writeFile (fileName, content) { From 5bc59a9dd4b6ce38b899488f361e9151cdbe6c2e Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 20 Feb 2023 17:48:37 +0100 Subject: [PATCH 18/50] fix comparinf bytecode --- libs/remix-lib/src/util.ts | 6 ++++++ libs/remix-lib/test/util.ts | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/libs/remix-lib/src/util.ts b/libs/remix-lib/src/util.ts index a89075721f..b38df71993 100644 --- a/libs/remix-lib/src/util.ts +++ b/libs/remix-lib/src/util.ts @@ -258,6 +258,12 @@ export function compareByteCode (code1, code2) { code2 = extractcborMetadata(code2) if (code1 && code2) { + if (code1.length !== code2.length) { + // if the length isn't the same, we have an issue with extracting the metadata hash. + const minLength = code1.length > code2.length ? code2.length: code1.length + code1 = code1.substr(0, minLength - 10) + code2 = code2.substr(0, minLength - 10) + } const compare = stringSimilarity.compareTwoStrings(code1, code2) return compare == 1 } diff --git a/libs/remix-lib/test/util.ts b/libs/remix-lib/test/util.ts index e19674a645..006485cb5c 100644 --- a/libs/remix-lib/test/util.ts +++ b/libs/remix-lib/test/util.ts @@ -102,9 +102,17 @@ tape('util.getInputParameters', function (t) { t.equal(util.getinputParameters(sampleERC721), '000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000001650000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016500000000000000000000000000000000000000000000000000000000000000') t.equal(util.getinputParameters(ERC721), '') +}) +tape('util.compareByteCode uniswap onchain vs solidity local compilation result', function (t) { + t.plan(1) + t.ok(util.compareByteCode(uniswapQuote2, uniswapQuote1), 'uniswap bytecode should be the same') }) +const uniswapQuote2 = `0x608060405234801561001057600080fd5b506004361061007d5760003560e01c8063c45a01551161005b578063c45a0155146100d3578063cdca1753146100db578063f7729d43146100ee578063fa461e33146101015761007d565b80632f80bb1d1461008257806330d07f21146100ab5780634aa4a4fc146100be575b600080fd5b610095610090366004610e9e565b610116565b6040516100a29190611148565b60405180910390f35b6100956100b9366004610e30565b61017b565b6100c6610340565b6040516100a29190611084565b6100c6610364565b6100956100e9366004610e9e565b610388565b6100956100fc366004610e30565b6103d6565b61011461010f366004610f04565b610555565b005b60005b600061012484610660565b9050600080600061013487610668565b92509250925061014882848389600061017b565b955083156101605761015987610699565b965061016c565b85945050505050610175565b50505050610119565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff808616878216109083166101a65760008490555b6101b18787876106ce565b73ffffffffffffffffffffffffffffffffffffffff1663128acb0830836101d78861070c565b60000373ffffffffffffffffffffffffffffffffffffffff8816156101fc5787610222565b8561021b5773fffd8963efd1fc6a506488495d951d5263988d25610222565b6401000276a45b8b8b8e6040516020016102379392919061101e565b6040516020818303038152906040526040518663ffffffff1660e01b81526004016102669594939291906110a5565b6040805180830381600087803b15801561027f57600080fd5b505af19250505080156102cd575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682019092526102ca91810190610ee1565b60015b610333573d8080156102fb576040519150601f19603f3d011682016040523d82523d6000602084013e610300565b606091505b5073ffffffffffffffffffffffffffffffffffffffff841661032157600080555b61032a8161073e565b92505050610337565b5050505b95945050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b60005b600061039684610660565b905060008060006103a687610668565b9250925092506103ba8383838960006103d6565b95508315610160576103cb87610699565b96505050505061038b565b600073ffffffffffffffffffffffffffffffffffffffff808616908716106103ff8787876106ce565b73ffffffffffffffffffffffffffffffffffffffff1663128acb0830836104258861070c565b73ffffffffffffffffffffffffffffffffffffffff881615610447578761046d565b856104665773fffd8963efd1fc6a506488495d951d5263988d2561046d565b6401000276a45b8c8b8d6040516020016104829392919061101e565b6040516020818303038152906040526040518663ffffffff1660e01b81526004016104b19594939291906110a5565b6040805180830381600087803b1580156104ca57600080fd5b505af1925050508015610518575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261051591810190610ee1565b60015b610333573d808015610546576040519150601f19603f3d011682016040523d82523d6000602084013e61054b565b606091505b5061032a8161073e565b60008313806105645750600082135b61056d57600080fd5b600080600061057b84610668565b9250925092506105ad7f00000000000000000000000000000000000000000000000000000000000000008484846107ef565b5060008060008089136105f3578573ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1610888a600003610628565b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161089896000035b925092509250821561063f57604051818152602081fd5b6000541561065557600054811461065557600080fd5b604051828152602081fd5b516042111590565b600080806106768482610805565b9250610683846014610905565b9050610690846017610805565b91509193909250565b80516060906101759083906017907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9016109f5565b60006107047f00000000000000000000000000000000000000000000000000000000000000006106ff868686610bdc565b610c59565b949350505050565b60007f8000000000000000000000000000000000000000000000000000000000000000821061073a57600080fd5b5090565b600081516020146107db5760448251101561078e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078590611111565b60405180910390fd5b600482019150818060200190518101906107a89190610f52565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078591906110f7565b818060200190518101906101759190610fbc565b600061033785610800868686610bdc565b610d8f565b60008182601401101561087957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f746f416464726573735f6f766572666c6f770000000000000000000000000000604482015290519081900360640190fd5b81601401835110156108ec57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f746f416464726573735f6f75744f66426f756e64730000000000000000000000604482015290519081900360640190fd5b5001602001516c01000000000000000000000000900490565b60008182600301101561097957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f746f55696e7432345f6f766572666c6f77000000000000000000000000000000604482015290519081900360640190fd5b81600301835110156109ec57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f746f55696e7432345f6f75744f66426f756e6473000000000000000000000000604482015290519081900360640190fd5b50016003015190565b60608182601f011015610a6957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f77000000000000000000000000000000000000604482015290519081900360640190fd5b828284011015610ada57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f77000000000000000000000000000000000000604482015290519081900360640190fd5b81830184511015610b4c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f736c6963655f6f75744f66426f756e6473000000000000000000000000000000604482015290519081900360640190fd5b606082158015610b6b5760405191506000825260208201604052610bd3565b6040519150601f8416801560200281840101858101878315602002848b0101015b81831015610ba4578051835260209283019201610b8c565b5050858452601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016604052505b50949350505050565b610be4610dbf565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161115610c1c579192915b506040805160608101825273ffffffffffffffffffffffffffffffffffffffff948516815292909316602083015262ffffff169181019190915290565b6000816020015173ffffffffffffffffffffffffffffffffffffffff16826000015173ffffffffffffffffffffffffffffffffffffffff1610610c9b57600080fd5b508051602080830151604093840151845173ffffffffffffffffffffffffffffffffffffffff94851681850152939091168385015262ffffff166060808401919091528351808403820181526080840185528051908301207fff0000000000000000000000000000000000000000000000000000000000000060a085015294901b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660a183015260b58201939093527fe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b5460d5808301919091528251808303909101815260f5909101909152805191012090565b6000610d9b8383610c59565b90503373ffffffffffffffffffffffffffffffffffffffff82161461017557600080fd5b604080516060810182526000808252602082018190529181019190915290565b600082601f830112610def578081fd5b8135610e02610dfd82611175565b611151565b818152846020838601011115610e16578283fd5b816020850160208301379081016020019190915292915050565b600080600080600060a08688031215610e47578081fd5b8535610e52816111e5565b94506020860135610e62816111e5565b9350604086013562ffffff81168114610e79578182fd5b9250606086013591506080860135610e90816111e5565b809150509295509295909350565b60008060408385031215610eb0578182fd5b823567ffffffffffffffff811115610ec6578283fd5b610ed285828601610ddf565b95602094909401359450505050565b60008060408385031215610ef3578182fd5b505080516020909101519092909150565b600080600060608486031215610f18578283fd5b8335925060208401359150604084013567ffffffffffffffff811115610f3c578182fd5b610f4886828701610ddf565b9150509250925092565b600060208284031215610f63578081fd5b815167ffffffffffffffff811115610f79578182fd5b8201601f81018413610f89578182fd5b8051610f97610dfd82611175565b818152856020838501011115610fab578384fd5b6103378260208301602086016111b5565b600060208284031215610fcd578081fd5b5051919050565b60008151808452610fec8160208601602086016111b5565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b606093841b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000908116825260e89390931b7fffffff0000000000000000000000000000000000000000000000000000000000166014820152921b166017820152602b0190565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b600073ffffffffffffffffffffffffffffffffffffffff8088168352861515602084015285604084015280851660608401525060a060808301526110ec60a0830184610fd4565b979650505050505050565b60006020825261110a6020830184610fd4565b9392505050565b60208082526010908201527f556e6578706563746564206572726f7200000000000000000000000000000000604082015260600190565b90815260200190565b60405181810167ffffffffffffffff8111828210171561116d57fe5b604052919050565b600067ffffffffffffffff82111561118957fe5b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b60005b838110156111d05781810151838201526020016111b8565b838111156111df576000848401525b50505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461120757600080fd5b5056fea26469706673582212204ba294eca0a366d4d8601eaa80323cb403aa01c4f4d2454757678b73f2acd97c64736f6c63430007060033` + +const uniswapQuote1 = `0x608060405234801561001057600080fd5b506004361061007d5760003560e01c8063c45a01551161005b578063c45a0155146100d3578063cdca1753146100db578063f7729d43146100ee578063fa461e33146101015761007d565b80632f80bb1d1461008257806330d07f21146100ab5780634aa4a4fc146100be575b600080fd5b610095610090366004610e9e565b610116565b6040516100a29190611148565b60405180910390f35b6100956100b9366004610e30565b61017b565b6100c6610340565b6040516100a29190611084565b6100c6610364565b6100956100e9366004610e9e565b610388565b6100956100fc366004610e30565b6103d6565b61011461010f366004610f04565b610555565b005b60005b600061012484610660565b9050600080600061013487610668565b92509250925061014882848389600061017b565b955083156101605761015987610699565b965061016c565b85945050505050610175565b50505050610119565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff808616878216109083166101a65760008490555b6101b18787876106ce565b73ffffffffffffffffffffffffffffffffffffffff1663128acb0830836101d78861070c565b60000373ffffffffffffffffffffffffffffffffffffffff8816156101fc5787610222565b8561021b5773fffd8963efd1fc6a506488495d951d5263988d25610222565b6401000276a45b8b8b8e6040516020016102379392919061101e565b6040516020818303038152906040526040518663ffffffff1660e01b81526004016102669594939291906110a5565b6040805180830381600087803b15801561027f57600080fd5b505af19250505080156102cd575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682019092526102ca91810190610ee1565b60015b610333573d8080156102fb576040519150601f19603f3d011682016040523d82523d6000602084013e610300565b606091505b5073ffffffffffffffffffffffffffffffffffffffff841661032157600080555b61032a8161073e565b92505050610337565b5050505b95945050505050565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b7f0000000000000000000000001f98431c8ad98523631ae4a59f267346ea31f98481565b60005b600061039684610660565b905060008060006103a687610668565b9250925092506103ba8383838960006103d6565b95508315610160576103cb87610699565b96505050505061038b565b600073ffffffffffffffffffffffffffffffffffffffff808616908716106103ff8787876106ce565b73ffffffffffffffffffffffffffffffffffffffff1663128acb0830836104258861070c565b73ffffffffffffffffffffffffffffffffffffffff881615610447578761046d565b856104665773fffd8963efd1fc6a506488495d951d5263988d2561046d565b6401000276a45b8c8b8d6040516020016104829392919061101e565b6040516020818303038152906040526040518663ffffffff1660e01b81526004016104b19594939291906110a5565b6040805180830381600087803b1580156104ca57600080fd5b505af1925050508015610518575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261051591810190610ee1565b60015b610333573d808015610546576040519150601f19603f3d011682016040523d82523d6000602084013e61054b565b606091505b5061032a8161073e565b60008313806105645750600082135b61056d57600080fd5b600080600061057b84610668565b9250925092506105ad7f0000000000000000000000001f98431c8ad98523631ae4a59f267346ea31f9848484846107ef565b5060008060008089136105f3578573ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1610888a600003610628565b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161089896000035b925092509250821561063f57604051818152602081fd5b6000541561065557600054811461065557600080fd5b604051828152602081fd5b516042111590565b600080806106768482610805565b9250610683846014610905565b9050610690846017610805565b91509193909250565b80516060906101759083906017907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9016109f5565b60006107047f0000000000000000000000001f98431c8ad98523631ae4a59f267346ea31f9846106ff868686610bdc565b610c59565b949350505050565b60007f8000000000000000000000000000000000000000000000000000000000000000821061073a57600080fd5b5090565b600081516020146107db5760448251101561078e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078590611111565b60405180910390fd5b600482019150818060200190518101906107a89190610f52565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078591906110f7565b818060200190518101906101759190610fbc565b600061033785610800868686610bdc565b610d8f565b60008182601401101561087957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f746f416464726573735f6f766572666c6f770000000000000000000000000000604482015290519081900360640190fd5b81601401835110156108ec57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f746f416464726573735f6f75744f66426f756e64730000000000000000000000604482015290519081900360640190fd5b5001602001516c01000000000000000000000000900490565b60008182600301101561097957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f746f55696e7432345f6f766572666c6f77000000000000000000000000000000604482015290519081900360640190fd5b81600301835110156109ec57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f746f55696e7432345f6f75744f66426f756e6473000000000000000000000000604482015290519081900360640190fd5b50016003015190565b60608182601f011015610a6957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f77000000000000000000000000000000000000604482015290519081900360640190fd5b828284011015610ada57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f77000000000000000000000000000000000000604482015290519081900360640190fd5b81830184511015610b4c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f736c6963655f6f75744f66426f756e6473000000000000000000000000000000604482015290519081900360640190fd5b606082158015610b6b5760405191506000825260208201604052610bd3565b6040519150601f8416801560200281840101858101878315602002848b0101015b81831015610ba4578051835260209283019201610b8c565b5050858452601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016604052505b50949350505050565b610be4610dbf565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161115610c1c579192915b506040805160608101825273ffffffffffffffffffffffffffffffffffffffff948516815292909316602083015262ffffff169181019190915290565b6000816020015173ffffffffffffffffffffffffffffffffffffffff16826000015173ffffffffffffffffffffffffffffffffffffffff1610610c9b57600080fd5b508051602080830151604093840151845173ffffffffffffffffffffffffffffffffffffffff94851681850152939091168385015262ffffff166060808401919091528351808403820181526080840185528051908301207fff0000000000000000000000000000000000000000000000000000000000000060a085015294901b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660a183015260b58201939093527fe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b5460d5808301919091528251808303909101815260f5909101909152805191012090565b6000610d9b8383610c59565b90503373ffffffffffffffffffffffffffffffffffffffff82161461017557600080fd5b604080516060810182526000808252602082018190529181019190915290565b600082601f830112610def578081fd5b8135610e02610dfd82611175565b611151565b818152846020838601011115610e16578283fd5b816020850160208301379081016020019190915292915050565b600080600080600060a08688031215610e47578081fd5b8535610e52816111e5565b94506020860135610e62816111e5565b9350604086013562ffffff81168114610e79578182fd5b9250606086013591506080860135610e90816111e5565b809150509295509295909350565b60008060408385031215610eb0578182fd5b823567ffffffffffffffff811115610ec6578283fd5b610ed285828601610ddf565b95602094909401359450505050565b60008060408385031215610ef3578182fd5b505080516020909101519092909150565b600080600060608486031215610f18578283fd5b8335925060208401359150604084013567ffffffffffffffff811115610f3c578182fd5b610f4886828701610ddf565b9150509250925092565b600060208284031215610f63578081fd5b815167ffffffffffffffff811115610f79578182fd5b8201601f81018413610f89578182fd5b8051610f97610dfd82611175565b818152856020838501011115610fab578384fd5b6103378260208301602086016111b5565b600060208284031215610fcd578081fd5b5051919050565b60008151808452610fec8160208601602086016111b5565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b606093841b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000908116825260e89390931b7fffffff0000000000000000000000000000000000000000000000000000000000166014820152921b166017820152602b0190565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b600073ffffffffffffffffffffffffffffffffffffffff8088168352861515602084015285604084015280851660608401525060a060808301526110ec60a0830184610fd4565b979650505050505050565b60006020825261110a6020830184610fd4565b9392505050565b60208082526010908201527f556e6578706563746564206572726f7200000000000000000000000000000000604082015260600190565b90815260200190565b60405181810167ffffffffffffffff8111828210171561116d57fe5b604052919050565b600067ffffffffffffffff82111561118957fe5b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b60005b838110156111d05781810151838201526020016111b8565b838111156111df576000848401525b50505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461120757600080fd5b5056fea164736f6c6343000706000a` + From 3612222f675cf2c0fcb6d77232c223174f6a6e7e Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 21 Feb 2023 15:32:25 +0100 Subject: [PATCH 19/50] add getContractDataFromByteCode --- libs/remix-core-plugin/src/lib/compiler-artefacts.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libs/remix-core-plugin/src/lib/compiler-artefacts.ts b/libs/remix-core-plugin/src/lib/compiler-artefacts.ts index 6c3752b33d..4e9c55c87d 100644 --- a/libs/remix-core-plugin/src/lib/compiler-artefacts.ts +++ b/libs/remix-core-plugin/src/lib/compiler-artefacts.ts @@ -5,7 +5,7 @@ import { CompilerAbstract } from '@remix-project/remix-solidity' const profile = { name: 'compilerArtefacts', - methods: ['get', 'addResolvedContract', 'getCompilerAbstract', 'getAllContractDatas', 'getLastCompilationResult', 'getArtefactsByContractName', 'getContractDataFromAddress'], + methods: ['get', 'addResolvedContract', 'getCompilerAbstract', 'getAllContractDatas', 'getLastCompilationResult', 'getArtefactsByContractName', 'getContractDataFromAddress', 'getContractDataFromByteCode'], events: [], version: '0.0.1' } @@ -212,12 +212,16 @@ export class CompilerArtefacts extends Plugin { async getContractDataFromAddress (address) { const code = await this.call('blockchain', 'getCode', address) + return this.getContractDataFromByteCode(code) + } + + async getContractDataFromByteCode (code) { let found this.filterAllContractDatas((file, contractsData) => { for (const name of Object.keys(contractsData)) { const contract = contractsData[name] if (util.compareByteCode(code, '0x' + contract.evm.deployedBytecode.object)) { - found = { name, contract } + found = { name, contract, file } return true } } From 21195e46619a1277d8b084c7d92fb29091e2a971 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 21 Feb 2023 15:33:11 +0100 Subject: [PATCH 20/50] ensure url are converted to path --- libs/remix-core-plugin/src/lib/compiler-artefacts.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/remix-core-plugin/src/lib/compiler-artefacts.ts b/libs/remix-core-plugin/src/lib/compiler-artefacts.ts index 4e9c55c87d..b0b5820c6a 100644 --- a/libs/remix-core-plugin/src/lib/compiler-artefacts.ts +++ b/libs/remix-core-plugin/src/lib/compiler-artefacts.ts @@ -194,8 +194,9 @@ export class CompilerArtefacts extends Plugin { } } - getCompilerAbstract (file) { - return this.compilersArtefactsPerFile[file] + async getCompilerAbstract (file) { + const path = await this.call('fileManager', 'getPathFromUrl', file) + return this.compilersArtefactsPerFile[path.file] } addResolvedContract (address: string, compilerData: CompilerAbstract) { From f2d2d3d309926296794e82936f6b1db3f59f3a7f Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 21 Feb 2023 15:34:14 +0100 Subject: [PATCH 21/50] fix replacing immutable ref --- libs/remix-lib/src/util.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/remix-lib/src/util.ts b/libs/remix-lib/src/util.ts index b38df71993..205488c941 100644 --- a/libs/remix-lib/src/util.ts +++ b/libs/remix-lib/src/util.ts @@ -300,12 +300,12 @@ function removeByIndex (code, index, length, emptyRef) { function removeImmutableReference (code1, code2) { try { - const refOccurence = code2.match(/7f000000000000000000000000000000000000000000000000000000000000000073/g) + const refOccurence = code2.match(/7f0000000000000000000000000000000000000000000000000000000000000000/g) if (!refOccurence) return code1 let offset = 0 refOccurence.map((value) => { offset = code2.indexOf(value, offset) - code1 = removeByIndex(code1, offset, value.length, '7f000000000000000000000000000000000000000000000000000000000000000073') + code1 = removeByIndex(code1, offset, value.length, '7f0000000000000000000000000000000000000000000000000000000000000000') offset = offset + 1 }) } catch (e) { From 7e2ca3de195ab93cdafacb99944576ae8291a190 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 21 Feb 2023 15:34:41 +0100 Subject: [PATCH 22/50] fix debugging with source code --- .../src/lib/compiler-fetch-and-compile.ts | 37 +++++++++++-------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/libs/remix-core-plugin/src/lib/compiler-fetch-and-compile.ts b/libs/remix-core-plugin/src/lib/compiler-fetch-and-compile.ts index 2b63efc433..ed53f4fea0 100644 --- a/libs/remix-core-plugin/src/lib/compiler-fetch-and-compile.ts +++ b/libs/remix-core-plugin/src/lib/compiler-fetch-and-compile.ts @@ -43,7 +43,14 @@ export class FetchAndCompile extends Plugin { async resolve (contractAddress, codeAtAddress, targetPath) { contractAddress = toChecksumAddress(contractAddress) - const localCompilation = async () => await this.call('compilerArtefacts', 'get', contractAddress) ? await this.call('compilerArtefacts', 'get', contractAddress) : await this.call('compilerArtefacts', 'get', '__last') ? await this.call('compilerArtefacts', 'get', '__last') : null + const localCompilation = async () => { + const contractData = await this.call('compilerArtefacts', 'getContractDataFromByteCode', codeAtAddress) + if (contractData) { + return await this.call('compilerArtefacts', 'getCompilerAbstract', contractData.file) + } + else + return await this.call('compilerArtefacts', 'get', '__last') + } const resolved = await this.call('compilerArtefacts', 'get', contractAddress) if (resolved) return resolved @@ -87,20 +94,20 @@ export class FetchAndCompile extends Plugin { return localCompilation() } if (!network) return localCompilation() - if (!this.sourceVerifierNetWork.includes(network.name)) return localCompilation() - - // check if the contract if part of the local compilation result - const compilation = await localCompilation() - if (compilation) { - let found = false - compilation.visitContracts((contract) => { - found = util.compareByteCode('0x' + contract.object.evm.deployedBytecode.object, codeAtAddress) - return found - }) - if (found) { - await this.call('compilerArtefacts', 'addResolvedContract', contractAddress, compilation) - setTimeout(_ => this.emit('usingLocalCompilation', contractAddress), 0) - return compilation + if (!this.sourceVerifierNetWork.includes(network.name)) { + // check if the contract if part of the local compilation result + const compilation = await localCompilation() + if (compilation) { + let found = false + compilation.visitContracts((contract) => { + found = util.compareByteCode('0x' + contract.object.evm.deployedBytecode.object, codeAtAddress) + return found + }) + if (found) { + await this.call('compilerArtefacts', 'addResolvedContract', contractAddress, compilation) + setTimeout(_ => this.emit('usingLocalCompilation', contractAddress), 0) + return compilation + } } } From b45b454319c4d611c3de030bb0426ec7ca2328b4 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 22 Feb 2023 10:19:54 +0100 Subject: [PATCH 23/50] fix test --- libs/remix-lib/test/util.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-lib/test/util.ts b/libs/remix-lib/test/util.ts index 006485cb5c..2f4b63926a 100644 --- a/libs/remix-lib/test/util.ts +++ b/libs/remix-lib/test/util.ts @@ -106,7 +106,7 @@ tape('util.getInputParameters', function (t) { tape('util.compareByteCode uniswap onchain vs solidity local compilation result', function (t) { t.plan(1) - t.ok(util.compareByteCode(uniswapQuote2, uniswapQuote1), 'uniswap bytecode should be the same') + t.ok(util.compareByteCode(uniswapQuote1, uniswapQuote2), 'uniswap bytecode should be the same') }) const uniswapQuote2 = `0x608060405234801561001057600080fd5b506004361061007d5760003560e01c8063c45a01551161005b578063c45a0155146100d3578063cdca1753146100db578063f7729d43146100ee578063fa461e33146101015761007d565b80632f80bb1d1461008257806330d07f21146100ab5780634aa4a4fc146100be575b600080fd5b610095610090366004610e9e565b610116565b6040516100a29190611148565b60405180910390f35b6100956100b9366004610e30565b61017b565b6100c6610340565b6040516100a29190611084565b6100c6610364565b6100956100e9366004610e9e565b610388565b6100956100fc366004610e30565b6103d6565b61011461010f366004610f04565b610555565b005b60005b600061012484610660565b9050600080600061013487610668565b92509250925061014882848389600061017b565b955083156101605761015987610699565b965061016c565b85945050505050610175565b50505050610119565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff808616878216109083166101a65760008490555b6101b18787876106ce565b73ffffffffffffffffffffffffffffffffffffffff1663128acb0830836101d78861070c565b60000373ffffffffffffffffffffffffffffffffffffffff8816156101fc5787610222565b8561021b5773fffd8963efd1fc6a506488495d951d5263988d25610222565b6401000276a45b8b8b8e6040516020016102379392919061101e565b6040516020818303038152906040526040518663ffffffff1660e01b81526004016102669594939291906110a5565b6040805180830381600087803b15801561027f57600080fd5b505af19250505080156102cd575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682019092526102ca91810190610ee1565b60015b610333573d8080156102fb576040519150601f19603f3d011682016040523d82523d6000602084013e610300565b606091505b5073ffffffffffffffffffffffffffffffffffffffff841661032157600080555b61032a8161073e565b92505050610337565b5050505b95945050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b60005b600061039684610660565b905060008060006103a687610668565b9250925092506103ba8383838960006103d6565b95508315610160576103cb87610699565b96505050505061038b565b600073ffffffffffffffffffffffffffffffffffffffff808616908716106103ff8787876106ce565b73ffffffffffffffffffffffffffffffffffffffff1663128acb0830836104258861070c565b73ffffffffffffffffffffffffffffffffffffffff881615610447578761046d565b856104665773fffd8963efd1fc6a506488495d951d5263988d2561046d565b6401000276a45b8c8b8d6040516020016104829392919061101e565b6040516020818303038152906040526040518663ffffffff1660e01b81526004016104b19594939291906110a5565b6040805180830381600087803b1580156104ca57600080fd5b505af1925050508015610518575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261051591810190610ee1565b60015b610333573d808015610546576040519150601f19603f3d011682016040523d82523d6000602084013e61054b565b606091505b5061032a8161073e565b60008313806105645750600082135b61056d57600080fd5b600080600061057b84610668565b9250925092506105ad7f00000000000000000000000000000000000000000000000000000000000000008484846107ef565b5060008060008089136105f3578573ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1610888a600003610628565b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161089896000035b925092509250821561063f57604051818152602081fd5b6000541561065557600054811461065557600080fd5b604051828152602081fd5b516042111590565b600080806106768482610805565b9250610683846014610905565b9050610690846017610805565b91509193909250565b80516060906101759083906017907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9016109f5565b60006107047f00000000000000000000000000000000000000000000000000000000000000006106ff868686610bdc565b610c59565b949350505050565b60007f8000000000000000000000000000000000000000000000000000000000000000821061073a57600080fd5b5090565b600081516020146107db5760448251101561078e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078590611111565b60405180910390fd5b600482019150818060200190518101906107a89190610f52565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078591906110f7565b818060200190518101906101759190610fbc565b600061033785610800868686610bdc565b610d8f565b60008182601401101561087957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f746f416464726573735f6f766572666c6f770000000000000000000000000000604482015290519081900360640190fd5b81601401835110156108ec57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f746f416464726573735f6f75744f66426f756e64730000000000000000000000604482015290519081900360640190fd5b5001602001516c01000000000000000000000000900490565b60008182600301101561097957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f746f55696e7432345f6f766572666c6f77000000000000000000000000000000604482015290519081900360640190fd5b81600301835110156109ec57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f746f55696e7432345f6f75744f66426f756e6473000000000000000000000000604482015290519081900360640190fd5b50016003015190565b60608182601f011015610a6957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f77000000000000000000000000000000000000604482015290519081900360640190fd5b828284011015610ada57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f77000000000000000000000000000000000000604482015290519081900360640190fd5b81830184511015610b4c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f736c6963655f6f75744f66426f756e6473000000000000000000000000000000604482015290519081900360640190fd5b606082158015610b6b5760405191506000825260208201604052610bd3565b6040519150601f8416801560200281840101858101878315602002848b0101015b81831015610ba4578051835260209283019201610b8c565b5050858452601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016604052505b50949350505050565b610be4610dbf565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161115610c1c579192915b506040805160608101825273ffffffffffffffffffffffffffffffffffffffff948516815292909316602083015262ffffff169181019190915290565b6000816020015173ffffffffffffffffffffffffffffffffffffffff16826000015173ffffffffffffffffffffffffffffffffffffffff1610610c9b57600080fd5b508051602080830151604093840151845173ffffffffffffffffffffffffffffffffffffffff94851681850152939091168385015262ffffff166060808401919091528351808403820181526080840185528051908301207fff0000000000000000000000000000000000000000000000000000000000000060a085015294901b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660a183015260b58201939093527fe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b5460d5808301919091528251808303909101815260f5909101909152805191012090565b6000610d9b8383610c59565b90503373ffffffffffffffffffffffffffffffffffffffff82161461017557600080fd5b604080516060810182526000808252602082018190529181019190915290565b600082601f830112610def578081fd5b8135610e02610dfd82611175565b611151565b818152846020838601011115610e16578283fd5b816020850160208301379081016020019190915292915050565b600080600080600060a08688031215610e47578081fd5b8535610e52816111e5565b94506020860135610e62816111e5565b9350604086013562ffffff81168114610e79578182fd5b9250606086013591506080860135610e90816111e5565b809150509295509295909350565b60008060408385031215610eb0578182fd5b823567ffffffffffffffff811115610ec6578283fd5b610ed285828601610ddf565b95602094909401359450505050565b60008060408385031215610ef3578182fd5b505080516020909101519092909150565b600080600060608486031215610f18578283fd5b8335925060208401359150604084013567ffffffffffffffff811115610f3c578182fd5b610f4886828701610ddf565b9150509250925092565b600060208284031215610f63578081fd5b815167ffffffffffffffff811115610f79578182fd5b8201601f81018413610f89578182fd5b8051610f97610dfd82611175565b818152856020838501011115610fab578384fd5b6103378260208301602086016111b5565b600060208284031215610fcd578081fd5b5051919050565b60008151808452610fec8160208601602086016111b5565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b606093841b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000908116825260e89390931b7fffffff0000000000000000000000000000000000000000000000000000000000166014820152921b166017820152602b0190565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b600073ffffffffffffffffffffffffffffffffffffffff8088168352861515602084015285604084015280851660608401525060a060808301526110ec60a0830184610fd4565b979650505050505050565b60006020825261110a6020830184610fd4565b9392505050565b60208082526010908201527f556e6578706563746564206572726f7200000000000000000000000000000000604082015260600190565b90815260200190565b60405181810167ffffffffffffffff8111828210171561116d57fe5b604052919050565b600067ffffffffffffffff82111561118957fe5b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b60005b838110156111d05781810151838201526020016111b8565b838111156111df576000848401525b50505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461120757600080fd5b5056fea26469706673582212204ba294eca0a366d4d8601eaa80323cb403aa01c4f4d2454757678b73f2acd97c64736f6c63430007060033` From 4acc88a976bbda0db264d3773ea40456cc7112e1 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 22 Feb 2023 12:00:30 +0100 Subject: [PATCH 24/50] fix type --- libs/remix-simulator/src/provider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-simulator/src/provider.ts b/libs/remix-simulator/src/provider.ts index 1c87e28105..264a9f7b4c 100644 --- a/libs/remix-simulator/src/provider.ts +++ b/libs/remix-simulator/src/provider.ts @@ -23,7 +23,7 @@ export class Provider { constructor (options: Record = {}) { this.options = options this.connected = true - this.vmContext = new VMContext(options['fork'] as string, options['nodeUrl'] as string, options['blockNumber'] as number) + this.vmContext = new VMContext(options['fork'] as string, options['nodeUrl'] as string, options['blockNumber'] as (number | 'latest')) this.Accounts = new Web3Accounts(this.vmContext) this.Transactions = new Transactions(this.vmContext) From cad986505db6642eedd8423466f0b2ea5be1e696 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 22 Feb 2023 12:34:44 +0100 Subject: [PATCH 25/50] fix getting compiler abstract --- .../src/lib/compiler-artefacts.ts | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/libs/remix-core-plugin/src/lib/compiler-artefacts.ts b/libs/remix-core-plugin/src/lib/compiler-artefacts.ts index b0b5820c6a..29552fa0f8 100644 --- a/libs/remix-core-plugin/src/lib/compiler-artefacts.ts +++ b/libs/remix-core-plugin/src/lib/compiler-artefacts.ts @@ -98,16 +98,17 @@ export class CompilerArtefacts extends Plugin { filterAllContractDatas (filter) { const contractsData = {} Object.keys(this.compilersArtefactsPerFile).map((targetFile) => { - const contracts = this.compilersArtefactsPerFile[targetFile].getContracts() + const artefact = this.compilersArtefactsPerFile[targetFile] + const contracts = artefact.getContracts() Object.keys(contracts).map((file) => { - if (filter(file, contracts[file])) contractsData[file] = contracts[file] + if (filter(file, contracts[file], artefact)) contractsData[file] = contracts[file] }) }) // making sure we save last compilation result in there if (this.compilersArtefacts.__last) { const contracts = this.compilersArtefacts.__last.getContracts() Object.keys(contracts).map((file) => { - if (filter(file, contracts[file])) contractsData[file] = contracts[file] + if (filter(file, contracts[file], this.compilersArtefacts.__last)) contractsData[file] = contracts[file] }) } return contractsData @@ -195,8 +196,19 @@ export class CompilerArtefacts extends Plugin { } async getCompilerAbstract (file) { + if (!file) return null + if (this.compilersArtefactsPerFile[file]) return this.compilersArtefactsPerFile[file] const path = await this.call('fileManager', 'getPathFromUrl', file) - return this.compilersArtefactsPerFile[path.file] + + if (path && path.file && this.compilersArtefactsPerFile[path.file])return this.compilersArtefactsPerFile[path.file] + + let artefact = null + this.filterAllContractDatas((localFile, data, parentArtefact) => { + if (localFile === file || (path && path.file && localFile === path.file)) { + artefact = parentArtefact + } + }) + return artefact } addResolvedContract (address: string, compilerData: CompilerAbstract) { From b945fae6bb1d21868358bd3efe8866c54016aeb6 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 22 Feb 2023 16:04:47 +0100 Subject: [PATCH 26/50] fix linting --- libs/remix-core-plugin/src/lib/compiler-artefacts.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-core-plugin/src/lib/compiler-artefacts.ts b/libs/remix-core-plugin/src/lib/compiler-artefacts.ts index 29552fa0f8..b1f9ac9634 100644 --- a/libs/remix-core-plugin/src/lib/compiler-artefacts.ts +++ b/libs/remix-core-plugin/src/lib/compiler-artefacts.ts @@ -200,7 +200,7 @@ export class CompilerArtefacts extends Plugin { if (this.compilersArtefactsPerFile[file]) return this.compilersArtefactsPerFile[file] const path = await this.call('fileManager', 'getPathFromUrl', file) - if (path && path.file && this.compilersArtefactsPerFile[path.file])return this.compilersArtefactsPerFile[path.file] + if (path && path.file && this.compilersArtefactsPerFile[path.file]) return this.compilersArtefactsPerFile[path.file] let artefact = null this.filterAllContractDatas((localFile, data, parentArtefact) => { From 47cb8eaffe8a47c91cf5119371700e3d1c441d9e Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 22 Feb 2023 15:48:44 +0100 Subject: [PATCH 27/50] fix asking permission if metamask is locked --- apps/remix-ide/src/app/providers/injected-provider.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide/src/app/providers/injected-provider.tsx b/apps/remix-ide/src/app/providers/injected-provider.tsx index 55f50850d1..6ac6742e5f 100644 --- a/apps/remix-ide/src/app/providers/injected-provider.tsx +++ b/apps/remix-ide/src/app/providers/injected-provider.tsx @@ -38,7 +38,7 @@ export class InjectedProvider extends Plugin implements IProvider { throw new Error(noInjectedProviderMsg) } else { if (injectedProvider && injectedProvider._metamask && injectedProvider._metamask.isUnlocked) { - if (!await injectedProvider._metamask.isUnlocked()) throw new Error('Please make sure the injected provider is unlocked (e.g Metamask).') + if (!await injectedProvider._metamask.isUnlocked()) this.call('notification', 'toast', 'Please make sure the injected provider is unlocked (e.g Metamask).') } this.askPermission(true) } From c10940e0d53550b58ee14f78eedb86c3eb470eca Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 22 Feb 2023 16:03:01 +0100 Subject: [PATCH 28/50] show msg if metamask not present --- apps/remix-ide/src/app/providers/injected-provider.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/remix-ide/src/app/providers/injected-provider.tsx b/apps/remix-ide/src/app/providers/injected-provider.tsx index 6ac6742e5f..e745c44c4d 100644 --- a/apps/remix-ide/src/app/providers/injected-provider.tsx +++ b/apps/remix-ide/src/app/providers/injected-provider.tsx @@ -35,6 +35,7 @@ export class InjectedProvider extends Plugin implements IProvider { async init () { const injectedProvider = (window as any).ethereum if (injectedProvider === undefined) { + this.call('notification', 'toast', noInjectedProviderMsg) throw new Error(noInjectedProviderMsg) } else { if (injectedProvider && injectedProvider._metamask && injectedProvider._metamask.isUnlocked) { From 781083ca4b4a1fcc91336c5ce43635a0e35d2e14 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 22 Feb 2023 16:03:25 +0100 Subject: [PATCH 29/50] fix linting --- apps/remix-ide/src/app/providers/injected-provider.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide/src/app/providers/injected-provider.tsx b/apps/remix-ide/src/app/providers/injected-provider.tsx index e745c44c4d..f35d36cb72 100644 --- a/apps/remix-ide/src/app/providers/injected-provider.tsx +++ b/apps/remix-ide/src/app/providers/injected-provider.tsx @@ -35,7 +35,7 @@ export class InjectedProvider extends Plugin implements IProvider { async init () { const injectedProvider = (window as any).ethereum if (injectedProvider === undefined) { - this.call('notification', 'toast', noInjectedProviderMsg) + this.call('notification', 'toast', noInjectedProviderMsg) throw new Error(noInjectedProviderMsg) } else { if (injectedProvider && injectedProvider._metamask && injectedProvider._metamask.isUnlocked) { From fdfd8ff72128e6a58605e4a4cfed809eb75fec65 Mon Sep 17 00:00:00 2001 From: lianahus Date: Wed, 22 Feb 2023 17:21:12 +0100 Subject: [PATCH 30/50] button in permission modal --- .../app/plugins/permission-handler-plugin.tsx | 221 +++++++++--------- .../src/lib/permission-dialog.tsx | 2 +- 2 files changed, 111 insertions(+), 112 deletions(-) diff --git a/apps/remix-ide/src/app/plugins/permission-handler-plugin.tsx b/apps/remix-ide/src/app/plugins/permission-handler-plugin.tsx index 955baed702..62748a53af 100644 --- a/apps/remix-ide/src/app/plugins/permission-handler-plugin.tsx +++ b/apps/remix-ide/src/app/plugins/permission-handler-plugin.tsx @@ -6,131 +6,130 @@ import { PermissionHandlerDialog, PermissionHandlerValue } from '@remix-ui/permi import { Profile } from '@remixproject/plugin-utils' const profile = { - name: 'permissionhandler', - displayName: 'permissionhandler', - description: 'Plugin to handle permissions', - methods: ['askPermission'] + name: 'permissionhandler', + displayName: 'permissionhandler', + description: 'Plugin to handle permissions', + methods: ['askPermission'] } - export class PermissionHandlerPlugin extends Plugin { - permissions: any - currentVersion: number - fallbackMemory: boolean - constructor() { - super(profile) - this.fallbackMemory = false - this.permissions = this._getFromLocal() - this.currentVersion = 1 - // here we remove the old permissions saved before adding 'permissionVersion' - // since with v1 the structure has been changed because of new engine ^0.2.0-alpha.6 changes - if (!localStorage.getItem('permissionVersion')) { - localStorage.setItem('plugins/permissions', '') - localStorage.setItem('permissionVersion', this.currentVersion.toString()) - } + permissions: any + currentVersion: number + fallbackMemory: boolean + constructor() { + super(profile) + this.fallbackMemory = false + this.permissions = this._getFromLocal() + this.currentVersion = 1 + // here we remove the old permissions saved before adding 'permissionVersion' + // since with v1 the structure has been changed because of new engine ^0.2.0-alpha.6 changes + if (!localStorage.getItem('permissionVersion')) { + localStorage.setItem('plugins/permissions', '') + localStorage.setItem('permissionVersion', this.currentVersion.toString()) } + } - _getFromLocal() { - if (this.fallbackMemory) return this.permissions - const permission = localStorage.getItem('plugins/permissions') - return permission ? JSON.parse(permission) : {} - } + _getFromLocal() { + if (this.fallbackMemory) return this.permissions + const permission = localStorage.getItem('plugins/permissions') + return permission ? JSON.parse(permission) : {} + } - persistPermissions() { - const permissions = JSON.stringify(this.permissions) - try { - localStorage.setItem('plugins/permissions', permissions) - } catch (e) { - this.fallbackMemory = true - console.log(e) - } + persistPermissions() { + const permissions = JSON.stringify(this.permissions) + try { + localStorage.setItem('plugins/permissions', permissions) + } catch (e) { + this.fallbackMemory = true + console.log(e) } + } - switchMode (from: Profile, to: Profile, method: string, set: boolean) { - set - ? this.permissions[to.name][method][from.name] = {} - : delete this.permissions[to.name][method][from.name] - } + switchMode (from: Profile, to: Profile, method: string, set: boolean) { + set + ? this.permissions[to.name][method][from.name] = {} + : delete this.permissions[to.name][method][from.name] + } - clear() { - localStorage.removeItem('plugins/permissions') - } + clear() { + localStorage.removeItem('plugins/permissions') + } - notAllowWarning(from: Profile, to: Profile, method: string) { - return `${from.displayName || from.name} is not allowed to call ${method} method of ${to.displayName || to.name}.` - } + notAllowWarning(from: Profile, to: Profile, method: string) { + return `${from.displayName || from.name} is not allowed to call ${method} method of ${to.displayName || to.name}.` + } - async getTheme() { - return (await this.call('theme', 'currentTheme')).quality - } + async getTheme() { + return (await this.call('theme', 'currentTheme')).quality + } - /** - * Check if a plugin has the permission to call another plugin and askPermission if needed - * @param {PluginProfile} from the profile of the plugin that make the call - * @param {ModuleProfile} to The profile of the module that receive the call - * @param {string} method The name of the function to be called - * @param {string} message from the caller plugin to add more details if needed - * @returns {Promise} - */ - async askPermission(from: Profile, to: Profile, method: string, message: string, sensitiveCall: boolean) { - try { - this.permissions = this._getFromLocal() - if (!this.permissions[to.name]) this.permissions[to.name] = {} - if (!this.permissions[to.name][method]) this.permissions[to.name][method] = {} - if (!this.permissions[to.name][method][from.name]) return this.openPermission(from, to, method, message, sensitiveCall) + /** + * Check if a plugin has the permission to call another plugin and askPermission if needed + * @param {PluginProfile} from the profile of the plugin that make the call + * @param {ModuleProfile} to The profile of the module that receive the call + * @param {string} method The name of the function to be called + * @param {string} message from the caller plugin to add more details if needed + * @returns {Promise} + */ + async askPermission(from: Profile, to: Profile, method: string, message: string, sensitiveCall: boolean) { + try { + this.permissions = this._getFromLocal() + if (!this.permissions[to.name]) this.permissions[to.name] = {} + if (!this.permissions[to.name][method]) this.permissions[to.name][method] = {} + if (!this.permissions[to.name][method][from.name]) return this.openPermission(from, to, method, message, sensitiveCall) - const { allow, hash } = this.permissions[to.name][method][from.name] - if (!allow) { - const warning = this.notAllowWarning(from, to, method) - this.call('notification', 'toast', warning) - return false - } - return hash === from.hash - ? true // Allow - : await this.openPermission(from, to, method, message, sensitiveCall) - } catch (err) { - throw new Error(err) - } + const { allow, hash } = this.permissions[to.name][method][from.name] + if (!allow) { + const warning = this.notAllowWarning(from, to, method) + this.call('notification', 'toast', warning) + return false + } + return hash === from.hash + ? true // Allow + : await this.openPermission(from, to, method, message, sensitiveCall) + } catch (err) { + throw new Error(err) } + } - async openPermission(from: Profile, to: Profile, method: string, message: string, sensitiveCall: boolean) { - const remember = this.permissions[to.name][method][from.name] - const value: PermissionHandlerValue = { - from, - to, - method, - message, - remember, - sensitiveCall + async openPermission(from: Profile, to: Profile, method: string, message: string, sensitiveCall: boolean) { + const remember = this.permissions[to.name][method][from.name] + const value: PermissionHandlerValue = { + from, + to, + method, + message, + remember, + sensitiveCall + } + const modal: AppModal = { + id: 'PermissionHandler', + title: , + message: , + okLabel: , + cancelLabel: + } + + const result = await this.call('notification', 'modal', modal) + return new Promise((resolve, reject) => { + if (result) { + if (this.permissions[to.name][method][from.name]) { + this.permissions[to.name][method][from.name] = { + allow: true, + hash: from.hash + } + this.persistPermissions() } - const modal: AppModal = { - id: 'PermissionHandler', - title: , - message: , - okLabel: , - cancelLabel: + resolve(true) + } else { + if (this.permissions[to.name][method][from.name]) { + this.permissions[to.name][method][from.name] = { + allow: false, + hash: from.hash + } + this.persistPermissions() } - - const result = await this.call('notification', 'modal', modal) - return new Promise((resolve, reject) => { - if (result) { - if (this.permissions[to.name][method][from.name]) { - this.permissions[to.name][method][from.name] = { - allow: true, - hash: from.hash - } - this.persistPermissions() - } - resolve(true) - } else { - if (this.permissions[to.name][method][from.name]) { - this.permissions[to.name][method][from.name] = { - allow: false, - hash: from.hash - } - this.persistPermissions() - } - reject(this.notAllowWarning(from, to, method)) - } - }) - } + reject(this.notAllowWarning(from, to, method)) + } + }) + } } diff --git a/libs/remix-ui/permission-handler/src/lib/permission-dialog.tsx b/libs/remix-ui/permission-handler/src/lib/permission-dialog.tsx index cd8fd03291..802050244b 100644 --- a/libs/remix-ui/permission-handler/src/lib/permission-dialog.tsx +++ b/libs/remix-ui/permission-handler/src/lib/permission-dialog.tsx @@ -62,7 +62,7 @@ const PermissionHandlerDialog = (props: PermissionHandlerProps) => {
} - +
{feedback}
) From 13fddc45c52c5008ac71c36f44282b84ad9c87e4 Mon Sep 17 00:00:00 2001 From: lianahus Date: Wed, 22 Feb 2023 17:46:25 +0100 Subject: [PATCH 31/50] proper focus for modal --- libs/remix-ui/modal-dialog/src/lib/remix-ui-modal-dialog.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 4d74918338..f60309c24e 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 @@ -98,7 +98,7 @@ export const ModalDialog = (props: ModalDialogProps) => { {/* todo add autofocus ^^ */} { props.okLabel && - - From 7f137518e6cceb75a3707988700942d6fc208bde Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 23 Feb 2023 15:17:05 +0100 Subject: [PATCH 40/50] remove the notification in sendAsync --- apps/remix-ide/src/app/providers/injected-provider.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/remix-ide/src/app/providers/injected-provider.tsx b/apps/remix-ide/src/app/providers/injected-provider.tsx index f35d36cb72..13d7793d7a 100644 --- a/apps/remix-ide/src/app/providers/injected-provider.tsx +++ b/apps/remix-ide/src/app/providers/injected-provider.tsx @@ -61,7 +61,6 @@ export class InjectedProvider extends Plugin implements IProvider { } try { if ((window as any) && typeof (window as any).ethereum.request === "function") (window as any).ethereum.request({ method: "eth_requestAccounts" }); - if (!await (window as any).ethereum._metamask.isUnlocked()) this.call('notification', 'toast', 'Please make sure the injected provider is unlocked (e.g Metamask).') const resultData = await this.provider.currentProvider.send(data.method, data.params) resolve({ jsonrpc: '2.0', result: resultData.result, id: data.id }) } catch (error) { From 46441192f5cb067f3f4f06148ca346cbd77e7ff6 Mon Sep 17 00:00:00 2001 From: lianahus Date: Thu, 23 Feb 2023 11:38:35 +0100 Subject: [PATCH 41/50] corrected alert ngs --- .../src/assets/css/themes/bootstrap-cyborg.min.css | 12 ++++++------ .../src/assets/css/themes/remix-dark_tvx1s2.css | 2 +- .../src/assets/css/themes/remix-hacker_owl.css | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/remix-ide/src/assets/css/themes/bootstrap-cyborg.min.css b/apps/remix-ide/src/assets/css/themes/bootstrap-cyborg.min.css index ced466267d..918bbb71b7 100644 --- a/apps/remix-ide/src/assets/css/themes/bootstrap-cyborg.min.css +++ b/apps/remix-ide/src/assets/css/themes/bootstrap-cyborg.min.css @@ -8611,28 +8611,28 @@ legend { text-decoration:underline } .alert-primary { - background-color:#2a9fd6 + background-color:#2a9fd685 } .alert-secondary { background-color:#555 } .alert-success { - background-color:#77b300 + background-color:#77b3007a } .alert-info { - background-color:#93c + background-color:#9933cc91 } .alert-warning { - background-color:#f80 + background-color:#ff8800a1 } .alert-danger { - background-color:#c00 + background-color:#cc00009c } .alert-light { background-color:#222 } .alert-dark { - background-color:#adafae + background-color:#adafae99 } .badge-warning { color:#fff diff --git a/apps/remix-ide/src/assets/css/themes/remix-dark_tvx1s2.css b/apps/remix-ide/src/assets/css/themes/remix-dark_tvx1s2.css index 5d59273a6b..a38163a92c 100644 --- a/apps/remix-ide/src/assets/css/themes/remix-dark_tvx1s2.css +++ b/apps/remix-ide/src/assets/css/themes/remix-dark_tvx1s2.css @@ -4481,7 +4481,7 @@ a.badge-dark:focus { } .alert-primary { color: #fff; - background-color: #5CBDEE; + background-color: #5cbdee94; border-color: #5CBDEE; } .alert-primary hr { diff --git a/apps/remix-ide/src/assets/css/themes/remix-hacker_owl.css b/apps/remix-ide/src/assets/css/themes/remix-hacker_owl.css index b5af4935ea..3db8d66dec 100644 --- a/apps/remix-ide/src/assets/css/themes/remix-hacker_owl.css +++ b/apps/remix-ide/src/assets/css/themes/remix-hacker_owl.css @@ -13,7 +13,7 @@ --cyan: #355f7d; --white: #fff; --gray: #8B99A6; - --gray-dark: #343a40; + --gray-dark: #8694a1; --primary: #007aa6; --secondary: #0E2A3E; --success: #C4E07F; @@ -4491,7 +4491,7 @@ a.badge-dark:focus { } .alert-primary { color: #fff; - background-color: #5CBDEE; + background-color: #5cbdee94; border-color: #5CBDEE; } .alert-primary hr { From aad2dfbce8ea7fb0a2d6406da290c019d3168579 Mon Sep 17 00:00:00 2001 From: lianahus Date: Thu, 23 Feb 2023 13:07:47 +0100 Subject: [PATCH 42/50] improved Delete all modal --- .../src/app/tabs/locales/en/filePanel.json | 6 ++-- .../src/app/tabs/locales/zh/filePanel.json | 7 ++-- .../workspace/src/lib/remix-ui-workspace.tsx | 33 +++++++++++-------- 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/locales/en/filePanel.json b/apps/remix-ide/src/app/tabs/locales/en/filePanel.json index fa9e3500c1..b398cb5e0e 100644 --- a/apps/remix-ide/src/app/tabs/locales/en/filePanel.json +++ b/apps/remix-ide/src/app/tabs/locales/en/filePanel.json @@ -10,7 +10,8 @@ "filePanel.workspace.delete": "Delete Workspace", "filePanel.workspace.deleteConfirm": "Are you sure to delete the current workspace?", "filePanel.workspace.deleteAll": "Delete All Workspaces", - "filePanel.workspace.deleteAllConfirm": "Are you absolutely sure you want to delete all your workspaces? Deleted workspaces can not be restored in any manner.", + "filePanel.workspace.deleteAllConfirm1": "Are you absolutely sure you want to delete all your workspaces?", + "filePanel.workspace.deleteAllConfirm2": "Deleted workspaces can not be restored in any manner.", "filePanel.workspace.name": "Workspace name", "filePanel.workspace.chooseTemplate": "Choose a template", "filePanel.workspace.download": "Backup Workspaces", @@ -54,5 +55,6 @@ "filePanel.customizeTemplate": "Customize template", "filePanel.features": "Features", "filePanel.upgradeability": "Upgradeability", - "filePanel.ok": "OK" + "filePanel.ok": "OK", + "filePanel.cancel": "Cancel" } diff --git a/apps/remix-ide/src/app/tabs/locales/zh/filePanel.json b/apps/remix-ide/src/app/tabs/locales/zh/filePanel.json index 94129f0d31..5a9b02983c 100644 --- a/apps/remix-ide/src/app/tabs/locales/zh/filePanel.json +++ b/apps/remix-ide/src/app/tabs/locales/zh/filePanel.json @@ -10,8 +10,8 @@ "filePanel.workspace.delete": "删除工作空间", "filePanel.workspace.deleteConfirm": "确定要删除当前工作空间?", "filePanel.workspace.deleteAll": "Delete All Workspaces", - "filePanel.workspace.deleteAllConfirm": "Are you absolutely sure you want to delete all your workspaces? Deleted workspaces can not be restored in any manner.", - "filePanel.workspace.name": "工作空间名称", + "filePanel.workspace.deleteAllConfirm1": "Are you absolutely sure you want to delete all your workspaces?", + "filePanel.workspace.deleteAllConfirm2": "Deleted workspaces can not be restored in any manner.", "filePanel.workspace.name": "工作空间名称", "filePanel.workspace.chooseTemplate": "选择一个工作空间模板", "filePanel.workspace.download": "下载工作空间", "filePanel.workspace.restore": "恢复工作空间", @@ -54,5 +54,6 @@ "filePanel.customizeTemplate": "自定义模板", "filePanel.features": "特点", "filePanel.upgradeability": "可升级性", - "filePanel.ok": "确认" + "filePanel.ok": "确认", + "filePanel.cancel": "Cancel" } diff --git a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx index 4a1f8fdd83..0bcf4d3ec9 100644 --- a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx +++ b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx @@ -73,11 +73,11 @@ export function Workspace () { }, [currentWorkspace]) const renameCurrentWorkspace = () => { - global.modal(intl.formatMessage({ id: 'filePanel.workspace.rename' }), renameModalMessage(), intl.formatMessage({ id: 'filePanel.ok' }), onFinishRenameWorkspace, '') + global.modal(intl.formatMessage({ id: 'filePanel.workspace.rename' }), renameModalMessage(), intl.formatMessage({ id: 'filePanel.ok' }), onFinishRenameWorkspace, intl.formatMessage({ id: 'filePanel.cancel' })) } const createWorkspace = () => { - global.modal(intl.formatMessage({ id: 'filePanel.workspace.create' }), createModalMessage(), intl.formatMessage({ id: 'filePanel.ok' }), onFinishCreateWorkspace, '') + global.modal(intl.formatMessage({ id: 'filePanel.workspace.create' }), createModalMessage(), intl.formatMessage({ id: 'filePanel.ok' }), onFinishCreateWorkspace, intl.formatMessage({ id: 'filePanel.cancel' })) } const deleteCurrentWorkspace = () => { @@ -86,17 +86,22 @@ export function Workspace () { intl.formatMessage({ id: 'filePanel.workspace.deleteConfirm' }), intl.formatMessage({ id: 'filePanel.ok' }), onFinishDeleteWorkspace, - '' + intl.formatMessage({ id: 'filePanel.cancel' }) ) } const deleteAllWorkspaces = () => { global.modal( intl.formatMessage({ id: 'filePanel.workspace.deleteAll' }), - intl.formatMessage({ id: 'filePanel.workspace.deleteAllConfirm' }), + <> +
+ {intl.formatMessage({ id: 'filePanel.workspace.deleteAllConfirm1' })} + {intl.formatMessage({ id: 'filePanel.workspace.deleteAllConfirm2' })} +
+ , intl.formatMessage({ id: 'filePanel.ok' }), onFinishDeleteAllWorkspaces, - '' + intl.formatMessage({ id: 'filePanel.cancel' }) ) } @@ -106,7 +111,7 @@ export function Workspace () { cloneModalMessage(), intl.formatMessage({ id: 'filePanel.ok' }), handleTypingUrl, - '' + intl.formatMessage({ id: 'filePanel.cancel' }) ) } @@ -146,7 +151,7 @@ export function Workspace () { try { await global.dispatchRenameWorkspace(currentWorkspace, workspaceName) } catch (e) { - global.modal(intl.formatMessage({ id: 'filePanel.workspace.rename' }), e.message, intl.formatMessage({ id: 'filePanel.ok' }), () => {}, '') + global.modal(intl.formatMessage({ id: 'filePanel.workspace.rename' }), e.message, intl.formatMessage({ id: 'filePanel.ok' }), () => {}, intl.formatMessage({ id: 'filePanel.cancel' })) console.error(e) } } @@ -172,7 +177,7 @@ export function Workspace () { try { await global.dispatchCreateWorkspace(workspaceName, workspaceTemplateName, opts, initGitRepo) } catch (e) { - global.modal(intl.formatMessage({ id: 'filePanel.workspace.create' }), e.message, intl.formatMessage({ id: 'filePanel.ok' }), () => {}, '') + global.modal(intl.formatMessage({ id: 'filePanel.workspace.create' }), e.message, intl.formatMessage({ id: 'filePanel.ok' }), () => {}, intl.formatMessage({ id: 'filePanel.cancel' })) console.error(e) } } @@ -181,7 +186,7 @@ export function Workspace () { try { await global.dispatchDeleteWorkspace(global.fs.browser.currentWorkspace) } catch (e) { - global.modal(intl.formatMessage({ id: 'filePanel.workspace.delete' }), e.message, intl.formatMessage({ id: 'filePanel.ok' }), () => {}, '') + global.modal(intl.formatMessage({ id: 'filePanel.workspace.delete' }), e.message, intl.formatMessage({ id: 'filePanel.ok' }), () => {}, intl.formatMessage({ id: 'filePanel.cancel' })) console.error(e) } } @@ -190,7 +195,7 @@ export function Workspace () { try { await global.dispatchDeleteAllWorkspaces() } catch (e) { - global.modal(intl.formatMessage({ id: 'filePanel.workspace.deleteAll' }), e.message, intl.formatMessage({ id: 'filePanel.ok' }), () => {}, '') + global.modal(intl.formatMessage({ id: 'filePanel.workspace.deleteAll' }), e.message, intl.formatMessage({ id: 'filePanel.ok' }), () => {}, intl.formatMessage({ id: 'filePanel.cancel' })) console.error(e) } } @@ -204,7 +209,7 @@ export function Workspace () { await global.dispatchSwitchToWorkspace(name) global.dispatchHandleExpandPath([]) } catch (e) { - global.modal(intl.formatMessage({ id: 'filePanel.workspace.switch' }), e.message, intl.formatMessage({ id: 'filePanel.ok' }), () => {}, '') + global.modal(intl.formatMessage({ id: 'filePanel.workspace.switch' }), e.message, intl.formatMessage({ id: 'filePanel.ok' }), () => {}, intl.formatMessage({ id: 'filePanel.cancel' })) console.error(e) } } @@ -240,7 +245,7 @@ export function Workspace () { intl.formatMessage({ id: 'filePanel.workspace.cloneMessage' }), intl.formatMessage({ id: 'filePanel.ok' }), () => {}, - '' + intl.formatMessage({ id: 'filePanel.cancel' }) ) } } @@ -279,7 +284,7 @@ export function Workspace () { } } catch (e) { console.error(e) - global.modal(intl.formatMessage({ id: 'filePanel.checkoutGitBranch' }), e.message, intl.formatMessage({ id: 'filePanel.ok' }), () => {}) + global.modal(intl.formatMessage({ id: 'filePanel.checkoutGitBranch' }), e.message, intl.formatMessage({ id: 'filePanel.ok' }), () => {}, intl.formatMessage({ id: 'filePanel.cancel' })) } } @@ -288,7 +293,7 @@ export function Workspace () { await global.dispatchCreateNewBranch(branchFilter) _paq.push(['trackEvent', 'Workspace', 'GIT', 'switch_to_new_branch']) } catch (e) { - global.modal(intl.formatMessage({ id: 'filePanel.checkoutGitBranch' }), e.message, intl.formatMessage({ id: 'filePanel.ok' }), () => {}) + global.modal(intl.formatMessage({ id: 'filePanel.checkoutGitBranch' }), e.message, intl.formatMessage({ id: 'filePanel.ok' }), () => {}, intl.formatMessage({ id: 'filePanel.cancel' })) } } From 0b5f29131c8051fb8ce0cb4ec142466840c2c101 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 27 Feb 2023 10:55:36 +0100 Subject: [PATCH 43/50] disable "deploy" if no account is selected --- .../remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx | 1 + libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx | 3 ++- libs/remix-ui/run-tab/src/lib/run-tab.tsx | 1 + libs/remix-ui/run-tab/src/lib/types/index.ts | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx index 6828170172..ef9d7fb720 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx @@ -319,6 +319,7 @@ export function ContractDropdownUI (props: ContractDropdownProps) { isValidProxyAddress={props.isValidProxyAddress} isValidProxyUpgrade={isValidProxyUpgrade} modal={props.modal} + disabled={props.selectedAccount === ''} />
{buttonOptions.content} diff --git a/libs/remix-ui/run-tab/src/lib/run-tab.tsx b/libs/remix-ui/run-tab/src/lib/run-tab.tsx index d01c86d6c4..ae5474e492 100644 --- a/libs/remix-ui/run-tab/src/lib/run-tab.tsx +++ b/libs/remix-ui/run-tab/src/lib/run-tab.tsx @@ -223,6 +223,7 @@ export function RunTabUI (props: RunTabProps) { passphrase={runTab.passphrase} /> JSX.Element export interface ContractDropdownProps { + selectedAccount: string, exEnvironment: string, contracts: { contractList: ContractList, From e5c6921d93291fa20199f4d2637cf1474e40b80b Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 27 Feb 2023 11:54:10 +0100 Subject: [PATCH 44/50] fix using compareByteCode --- apps/remix-ide/src/app/tabs/debugger-tab.js | 4 ---- libs/remix-core-plugin/src/lib/compiler-fetch-and-compile.ts | 3 +-- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/debugger-tab.js b/apps/remix-ide/src/app/tabs/debugger-tab.js index 8d357acc65..2d49dcc6c7 100644 --- a/apps/remix-ide/src/app/tabs/debugger-tab.js +++ b/apps/remix-ide/src/app/tabs/debugger-tab.js @@ -45,10 +45,6 @@ export class DebuggerTab extends DebuggerApiMixin(ViewPlugin) { this.call('notification', 'toast', notFoundToastMsg(contractAddress)) }) - this.on('fetchAndCompile', 'usingLocalCompilation', (contractAddress) => { - this.call('notification', 'toast', localCompilationToastMsg()) - }) - this.on('fetchAndCompile', 'sourceVerificationNotAvailable', () => { this.call('notification', 'toast', sourceVerificationNotAvailableToastMsg()) }) diff --git a/libs/remix-core-plugin/src/lib/compiler-fetch-and-compile.ts b/libs/remix-core-plugin/src/lib/compiler-fetch-and-compile.ts index ed53f4fea0..810faadd2c 100644 --- a/libs/remix-core-plugin/src/lib/compiler-fetch-and-compile.ts +++ b/libs/remix-core-plugin/src/lib/compiler-fetch-and-compile.ts @@ -100,12 +100,11 @@ export class FetchAndCompile extends Plugin { if (compilation) { let found = false compilation.visitContracts((contract) => { - found = util.compareByteCode('0x' + contract.object.evm.deployedBytecode.object, codeAtAddress) + found = util.compareByteCode(codeAtAddress, '0x' + contract.object.evm.deployedBytecode.object) return found }) if (found) { await this.call('compilerArtefacts', 'addResolvedContract', contractAddress, compilation) - setTimeout(_ => this.emit('usingLocalCompilation', contractAddress), 0) return compilation } } From 40f907d95febe0c8a7c480f4c4ad9f355030c22d Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 23 Feb 2023 17:18:39 +0100 Subject: [PATCH 45/50] set the provider only when it is initiated --- .../src/tests/transactionExecution.test.ts | 49 ++++++++++++++++++- apps/remix-ide/src/blockchain/providers/vm.js | 33 +++++++------ .../src/blockchain/providers/worker-vm.ts | 13 ++++- 3 files changed, 78 insertions(+), 17 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/transactionExecution.test.ts b/apps/remix-ide-e2e/src/tests/transactionExecution.test.ts index f22f843e9e..d91ec90bee 100644 --- a/apps/remix-ide-e2e/src/tests/transactionExecution.test.ts +++ b/apps/remix-ide-e2e/src/tests/transactionExecution.test.ts @@ -213,7 +213,28 @@ module.exports = { 'uint256 num': '24' } }) - .end() + }, + + 'Should switch to the mainnet VM fork and execute a tx to query ENS #group5': function (browser: NightwatchBrowser) { + let addressRef + browser + .addFile('mainnet_ens.sol', sources[7]['mainnet_ens.sol']) + .clickLaunchIcon('solidity') + .setSolidityCompilerVersion('soljson-v0.8.17+commit.8df45f5f.js') + .clickLaunchIcon('udapp') + .switchEnvironment('vm-mainnet-fork') + .waitForElementPresent('select[data-id="runTabSelectAccount"] option[value="0xdD870fA1b7C4700F2BD7f44238821C26f7392148"]') // wait for the udapp to load the list of accounts + .selectContract('MyResolver') + .createContract('') + .clickInstance(0) + .getAddressAtPosition(0, (address) => { + addressRef = address + }) + .clickFunction('resolve - call') + .perform((done) => { + browser.verifyCallReturnValue(addressRef, ['0:address: 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045']) + .perform(() => done()) + }) } } @@ -431,5 +452,31 @@ contract C { } }` } + }, { + 'mainnet_ens.sol': { + content: + ` + import "https://github.com/ensdomains/ens-contracts/blob/master/contracts/utils/NameEncoder.sol"; + + abstract contract ENS { + function resolver(bytes32 node) public virtual view returns (Resolver); + } + + abstract contract Resolver { + function addr(bytes32 node) public virtual view returns (address); + } + + contract MyResolver { + // Same address for Mainet, Ropsten, Rinkerby, Gorli and other networks; + ENS ens = ENS(0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e); + + function resolve() public view returns(address) { + (,bytes32 node) = NameEncoder.dnsEncodeName("vitalik.eth"); + Resolver resolver = ens.resolver(node); + return resolver.addr(node); + } + } + ` + } } ] diff --git a/apps/remix-ide/src/blockchain/providers/vm.js b/apps/remix-ide/src/blockchain/providers/vm.js index 96466065ca..a4a600bbf8 100644 --- a/apps/remix-ide/src/blockchain/providers/vm.js +++ b/apps/remix-ide/src/blockchain/providers/vm.js @@ -24,27 +24,30 @@ class VMProvider { this.worker = new Worker(new URL('./worker-vm', import.meta.url)) const provider = this.executionContext.getProviderObject() - this.worker.postMessage({ cmd: 'init', fork: this.executionContext.getCurrentFork(), nodeUrl: provider?.options['nodeUrl'], blockNumber: provider?.options['blockNumber']}) - let incr = 0 const stamps = {} this.worker.addEventListener('message', (msg) => { - if (stamps[msg.data.stamp]) { + if (msg.data.cmd === 'sendAsyncResult' && stamps[msg.data.stamp]) { stamps[msg.data.stamp](msg.data.error, msg.data.result) + } else if (msg.data.cmd === 'initiateResult') { + if (!msg.data.error) { + this.provider = { + sendAsync: (query, callback) => { + const stamp = Date.now() + incr + incr++ + stamps[stamp] = callback + this.worker.postMessage({ cmd: 'sendAsync', query, stamp }) + } + } + this.web3 = new Web3(this.provider) + extend(this.web3) + this.accounts = {} + this.executionContext.setWeb3(this.executionContext.getProvider(), this.web3) + } } }) - this.provider = { - sendAsync: (query, callback) => { - const stamp = Date.now() + incr - incr++ - stamps[stamp] = callback - this.worker.postMessage({ cmd: 'sendAsync', query, stamp }) - } - } - this.web3 = new Web3(this.provider) - extend(this.web3) - this.accounts = {} - this.executionContext.setWeb3(this.executionContext.getProvider(), this.web3) + + this.worker.postMessage({ cmd: 'init', fork: this.executionContext.getCurrentFork(), nodeUrl: provider?.options['nodeUrl'], blockNumber: provider?.options['blockNumber']}) } // TODO: is still here because of the plugin API diff --git a/apps/remix-ide/src/blockchain/providers/worker-vm.ts b/apps/remix-ide/src/blockchain/providers/worker-vm.ts index 55ebb013a1..7473e6ce37 100644 --- a/apps/remix-ide/src/blockchain/providers/worker-vm.ts +++ b/apps/remix-ide/src/blockchain/providers/worker-vm.ts @@ -7,7 +7,18 @@ self.onmessage = (e: MessageEvent) => { case 'init': { provider = new Provider({ fork: data.fork, nodeUrl: data.nodeUrl, blockNumber: data.blockNumber }) - if (provider) provider.init() + provider.init().then(() => { + self.postMessage({ + cmd: 'initiateResult', + stamp: data.stamp + }) + }).catch((error) => { + self.postMessage({ + cmd: 'initiateResult', + error, + stamp: data.stamp + }) + }) break } case 'sendAsync': From a03758a7407bf8c412ad2dbdd6e394c8db96115a Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Mon, 27 Feb 2023 15:44:02 +0100 Subject: [PATCH 46/50] fix social icons breaking rank --- .../home-tab/src/lib/components/homeTabTitle.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabTitle.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabTitle.tsx index 93808e3e00..7861d95bf6 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabTitle.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabTitle.tsx @@ -68,7 +68,7 @@ function HomeTabTitle() { >
- + + className="border-0 h-100 btn fab fa-youtube p-1 pl-2"> @@ -97,7 +97,7 @@ function HomeTabTitle() { openLink("https://twitter.com/EthereumRemix") _paq.push(['trackEvent', 'hometab', 'socialMedia', 'twitter']) }} - className="border-0 p-2 h-100 pl-2 btn fab fa-twitter"> + className="border-0 p-1 h-100 pl-2 btn fab fa-twitter">
@@ -113,7 +113,7 @@ function HomeTabTitle() { openLink("https://www.linkedin.com/company/ethereum-remix/") _paq.push(['trackEvent', 'hometab', 'socialmedia', 'linkedin']) }} - className="border-0 p-2 h-100 pl-2 btn fa fa-linkedin"> + className="border-0 p-1 h-100 pl-2 btn fa fa-linkedin"> @@ -129,7 +129,7 @@ function HomeTabTitle() { openLink("https://medium.com/remix-ide") _paq.push(['trackEvent', 'hometab', 'socialmedia', 'medium']) }} - className="border-0 p-2 h-100 pl-2 btn fab fa-medium"> + className="border-0 p-1 h-100 pl-2 btn fab fa-medium"> @@ -145,7 +145,7 @@ function HomeTabTitle() { openLink("https://discord.gg/mh9hFCKkEq") _paq.push(['trackEvent', 'hometab', 'socialmedia', 'discord']) }} - className="border-0 h-100 p-2 btn fab fa-discord"> + className="border-0 h-100 p-1 pr-2 btn fab fa-discord"> From 87a0fe573378a9b38de58f37b5985b4ef6caac1e Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Mon, 27 Feb 2023 21:31:30 +0530 Subject: [PATCH 47/50] bump remixd --- libs/remixd/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remixd/package.json b/libs/remixd/package.json index c3754c91f5..dbf2926dd7 100644 --- a/libs/remixd/package.json +++ b/libs/remixd/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remixd", - "version": "0.6.11", + "version": "0.6.12", "description": "remix server: allow accessing file system from remix.ethereum.org and start a dev environment (see help section)", "main": "index.js", "types": "./index.d.ts", From 6d694c4fe0e78b2d14d158a9c1f164cd2f985822 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Mon, 27 Feb 2023 21:34:39 +0530 Subject: [PATCH 48/50] remove console log --- libs/remix-simulator/src/vm-context.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/libs/remix-simulator/src/vm-context.ts b/libs/remix-simulator/src/vm-context.ts index dc420c931a..5ee49e6cc2 100644 --- a/libs/remix-simulator/src/vm-context.ts +++ b/libs/remix-simulator/src/vm-context.ts @@ -168,7 +168,6 @@ export class VMContext { async createVm (hardfork) { let stateManager: StateManager - console.log('creating a new VM', hardfork, this.nodeUrl, this.blockNumber) if (this.nodeUrl) { let block = this.blockNumber if (this.blockNumber === 'latest') { From 41e98e190b70a92b6f7dceadc8d917a8da16149a Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Mon, 27 Feb 2023 21:41:34 +0530 Subject: [PATCH 49/50] publish remix libs --- libs/ghaction-helper/package.json | 12 +++++++----- libs/remix-analyzer/package.json | 8 ++++---- libs/remix-astwalker/package.json | 6 +++--- libs/remix-debug/package.json | 12 ++++++------ libs/remix-lib/package.json | 6 +++--- libs/remix-simulator/package.json | 6 +++--- libs/remix-solidity/package.json | 6 +++--- libs/remix-tests/package.json | 10 +++++----- libs/remix-url-resolver/package.json | 4 ++-- libs/remix-ws-templates/package.json | 4 ++-- 10 files changed, 38 insertions(+), 36 deletions(-) diff --git a/libs/ghaction-helper/package.json b/libs/ghaction-helper/package.json index b9f6995076..b1f397657a 100644 --- a/libs/ghaction-helper/package.json +++ b/libs/ghaction-helper/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/ghaction-helper", - "version": "0.1.5", + "version": "0.1.6", "description": "Solidity Tests GitHub Action Helper", "main": "src/index.js", "scripts": { @@ -19,14 +19,16 @@ }, "homepage": "https://github.com/ethereum/remix-project#readme", "devDependencies": { - "@remix-project/remix-solidity": "^0.5.9", + "@remix-project/remix-solidity": "^0.5.10", "@types/chai": "^4.3.4", "typescript": "^4.9.3" }, "dependencies": { "@ethereum-waffle/chai": "^3.4.4", + "@remix-project/remix-simulator": "^0.2.24", "chai": "^4.3.7", - "ethers": "^5.7.2", - "@remix-project/remix-simulator": "^0.2.21" - } + "ethers": "^5.7.2" + }, + "types": "./src/index.d.ts", + "gitHead": "c1415e0c3751af8bf53292d67fedf68e15bf3b23" } \ No newline at end of file diff --git a/libs/remix-analyzer/package.json b/libs/remix-analyzer/package.json index 5f5fd5846e..e9b700f0ad 100644 --- a/libs/remix-analyzer/package.json +++ b/libs/remix-analyzer/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-analyzer", - "version": "0.5.32", + "version": "0.5.33", "description": "Tool to perform static analysis on Solidity smart contracts", "scripts": { "test": "./../../node_modules/.bin/ts-node --project ../../tsconfig.base.json --require tsconfig-paths/register ./../../node_modules/.bin/tape ./test/tests.ts" @@ -25,8 +25,8 @@ "@ethereumjs/tx": "^4.0.2", "@ethereumjs/util": "^8.0.3", "@ethereumjs/vm": "^6.3.0", - "@remix-project/remix-astwalker": "^0.0.53", - "@remix-project/remix-lib": "^0.5.23", + "@remix-project/remix-astwalker": "^0.0.54", + "@remix-project/remix-lib": "^0.5.24", "async": "^2.6.2", "ethers": "^5.4.2", "ethjs-util": "^0.1.6", @@ -50,6 +50,6 @@ "typescript": "^3.7.5" }, "typings": "src/index.d.ts", - "gitHead": "69af4eddd1ba47f76a71c78077d453deb572b1a0", + "gitHead": "c1415e0c3751af8bf53292d67fedf68e15bf3b23", "main": "./src/index.js" } \ No newline at end of file diff --git a/libs/remix-astwalker/package.json b/libs/remix-astwalker/package.json index cf10d5915e..50101ee834 100644 --- a/libs/remix-astwalker/package.json +++ b/libs/remix-astwalker/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-astwalker", - "version": "0.0.53", + "version": "0.0.54", "description": "Tool to walk through Solidity AST", "main": "src/index.js", "scripts": { @@ -37,7 +37,7 @@ "@ethereumjs/tx": "^4.0.2", "@ethereumjs/util": "^8.0.3", "@ethereumjs/vm": "^6.3.0", - "@remix-project/remix-lib": "^0.5.23", + "@remix-project/remix-lib": "^0.5.24", "@types/tape": "^4.2.33", "async": "^2.6.2", "ethers": "^5.4.2", @@ -53,6 +53,6 @@ "tap-spec": "^5.0.0" }, "typings": "src/index.d.ts", - "gitHead": "69af4eddd1ba47f76a71c78077d453deb572b1a0", + "gitHead": "c1415e0c3751af8bf53292d67fedf68e15bf3b23", "types": "./src/index.d.ts" } \ No newline at end of file diff --git a/libs/remix-debug/package.json b/libs/remix-debug/package.json index 61d2d08325..868fe3d4b5 100644 --- a/libs/remix-debug/package.json +++ b/libs/remix-debug/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-debug", - "version": "0.5.23", + "version": "0.5.24", "description": "Tool to debug Ethereum transactions", "contributors": [ { @@ -26,10 +26,10 @@ "@ethereumjs/tx": "^4.0.2", "@ethereumjs/util": "^8.0.3", "@ethereumjs/vm": "^6.3.0", - "@remix-project/remix-astwalker": "^0.0.53", - "@remix-project/remix-lib": "^0.5.23", - "@remix-project/remix-simulator": "^0.2.23", - "@remix-project/remix-solidity": "^0.5.9", + "@remix-project/remix-astwalker": "^0.0.54", + "@remix-project/remix-lib": "^0.5.24", + "@remix-project/remix-simulator": "^0.2.24", + "@remix-project/remix-solidity": "^0.5.10", "ansi-gray": "^0.1.1", "async": "^2.6.2", "color-support": "^1.1.3", @@ -69,6 +69,6 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-debug#readme", "typings": "src/index.d.ts", - "gitHead": "69af4eddd1ba47f76a71c78077d453deb572b1a0", + "gitHead": "c1415e0c3751af8bf53292d67fedf68e15bf3b23", "types": "./src/index.d.ts" } \ No newline at end of file diff --git a/libs/remix-lib/package.json b/libs/remix-lib/package.json index e6b0f8208f..12e47f9839 100644 --- a/libs/remix-lib/package.json +++ b/libs/remix-lib/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-lib", - "version": "0.5.23", + "version": "0.5.24", "description": "Library to various Remix tools", "contributors": [ { @@ -17,8 +17,8 @@ "test": "./../../node_modules/.bin/ts-node --require tsconfig-paths/register ./../../node_modules/.bin/tape ./test/tests.ts" }, "dependencies": { - "async": "^2.1.2", "@ethereumjs/util": "^8.0.3", + "async": "^2.1.2", "ethers": "^4.0.40", "ethjs-util": "^0.1.6", "events": "^3.0.0", @@ -51,6 +51,6 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-lib#readme", "typings": "src/index.d.ts", - "gitHead": "69af4eddd1ba47f76a71c78077d453deb572b1a0", + "gitHead": "c1415e0c3751af8bf53292d67fedf68e15bf3b23", "types": "./src/index.d.ts" } \ No newline at end of file diff --git a/libs/remix-simulator/package.json b/libs/remix-simulator/package.json index 86ed0b5851..6d07ab48b6 100644 --- a/libs/remix-simulator/package.json +++ b/libs/remix-simulator/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-simulator", - "version": "0.2.23", + "version": "0.2.24", "description": "Ethereum IDE and tools for the web", "contributors": [ { @@ -22,7 +22,7 @@ "@ethereumjs/tx": "^4.0.2", "@ethereumjs/util": "^8.0.3", "@ethereumjs/vm": "^6.3.0", - "@remix-project/remix-lib": "^0.5.23", + "@remix-project/remix-lib": "^0.5.24", "ansi-gray": "^0.1.1", "async": "^3.1.0", "body-parser": "^1.18.2", @@ -67,6 +67,6 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-simulator#readme", "typings": "src/index.d.ts", - "gitHead": "69af4eddd1ba47f76a71c78077d453deb572b1a0", + "gitHead": "c1415e0c3751af8bf53292d67fedf68e15bf3b23", "types": "./src/index.d.ts" } \ No newline at end of file diff --git a/libs/remix-solidity/package.json b/libs/remix-solidity/package.json index a5a41100b8..83c8882dc5 100644 --- a/libs/remix-solidity/package.json +++ b/libs/remix-solidity/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-solidity", - "version": "0.5.9", + "version": "0.5.10", "description": "Tool to load and run Solidity compiler", "main": "src/index.js", "types": "src/index.d.ts", @@ -19,7 +19,7 @@ "@ethereumjs/tx": "^4.0.2", "@ethereumjs/util": "^8.0.3", "@ethereumjs/vm": "^6.3.0", - "@remix-project/remix-lib": "^0.5.23", + "@remix-project/remix-lib": "^0.5.24", "async": "^2.6.2", "eslint-scope": "^5.0.0", "ethers": "^5.4.2", @@ -57,5 +57,5 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-solidity#readme", "typings": "src/index.d.ts", - "gitHead": "69af4eddd1ba47f76a71c78077d453deb572b1a0" + "gitHead": "c1415e0c3751af8bf53292d67fedf68e15bf3b23" } \ No newline at end of file diff --git a/libs/remix-tests/package.json b/libs/remix-tests/package.json index 17bebaaabe..a395848323 100644 --- a/libs/remix-tests/package.json +++ b/libs/remix-tests/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-tests", - "version": "0.2.23", + "version": "0.2.24", "description": "Tool to test Solidity smart contracts", "main": "src/index.js", "types": "./src/index.d.ts", @@ -41,9 +41,9 @@ "@ethereumjs/tx": "^4.0.2", "@ethereumjs/util": "^8.0.3", "@ethereumjs/vm": "^6.3.0", - "@remix-project/remix-lib": "^0.5.23", - "@remix-project/remix-simulator": "^0.2.23", - "@remix-project/remix-solidity": "^0.5.9", + "@remix-project/remix-lib": "^0.5.24", + "@remix-project/remix-simulator": "^0.2.24", + "@remix-project/remix-solidity": "^0.5.10", "@remix-project/remix-url-resolver": "^0.0.42", "ansi-gray": "^0.1.1", "async": "^2.6.0", @@ -78,5 +78,5 @@ "typescript": "^3.3.1" }, "typings": "src/index.d.ts", - "gitHead": "69af4eddd1ba47f76a71c78077d453deb572b1a0" + "gitHead": "c1415e0c3751af8bf53292d67fedf68e15bf3b23" } \ No newline at end of file diff --git a/libs/remix-url-resolver/package.json b/libs/remix-url-resolver/package.json index 2cae054c65..d66a834954 100644 --- a/libs/remix-url-resolver/package.json +++ b/libs/remix-url-resolver/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-url-resolver", - "version": "0.0.45", + "version": "0.0.46", "description": "Solidity import url resolver engine", "main": "src/index.js", "types": "src/index.d.ts", @@ -40,5 +40,5 @@ "typescript": "^3.1.6" }, "typings": "src/index.d.ts", - "gitHead": "69af4eddd1ba47f76a71c78077d453deb572b1a0" + "gitHead": "c1415e0c3751af8bf53292d67fedf68e15bf3b23" } \ No newline at end of file diff --git a/libs/remix-ws-templates/package.json b/libs/remix-ws-templates/package.json index 8f4058b563..84a5448aad 100644 --- a/libs/remix-ws-templates/package.json +++ b/libs/remix-ws-templates/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-ws-templates", - "version": "1.0.10", + "version": "1.0.11", "description": "Create a Remix IDE workspace using different templates", "main": "src/index.js", "types": "src/index.d.ts", @@ -25,5 +25,5 @@ "ethers": "^5.4.2", "web3": "^1.5.1" }, - "gitHead": "69af4eddd1ba47f76a71c78077d453deb572b1a0" + "gitHead": "c1415e0c3751af8bf53292d67fedf68e15bf3b23" } \ No newline at end of file From c033bfd22c72fd3b0c059170019e40b021f6b3cd Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Tue, 28 Feb 2023 13:02:38 +0530 Subject: [PATCH 50/50] bump dev version to 0.32.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4d9400656d..2e1e8e505a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "remix-project", - "version": "0.31.0-dev", + "version": "0.32.0-dev", "license": "MIT", "description": "Ethereum Remix Monorepo", "keywords": [