From d0851b1b4d9fd5b53f274e7545b70f6ae0cbf17e Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Thu, 23 Feb 2023 18:51:22 +0530 Subject: [PATCH 01/13] fix copy bytecode --- libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx b/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx index afc67f7370..43f18580dd 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx @@ -188,7 +188,8 @@ export const ContractSelection = (props: ContractSelectionProps) => { } const copyBytecode = () => { - return copyContractProperty('bytecode') + const bytecodeObj = JSON.parse(copyContractProperty('bytecode')) + return bytecodeObj.object } return ( From 1c799c19f76dfc6d5c3fe19cf67838a2f873f233 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Thu, 23 Feb 2023 19:09:09 +0530 Subject: [PATCH 02/13] fix tip and remove title --- .../solidity-compiler/src/lib/contract-selection.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx b/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx index 43f18580dd..d9809d061c 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx @@ -245,14 +245,14 @@ export const ContractSelection = (props: ContractSelectionProps) => {
- - - - From 7f137518e6cceb75a3707988700942d6fc208bde Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 23 Feb 2023 15:17:05 +0100 Subject: [PATCH 03/13] 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 04/13] 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 05/13] 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 06/13] 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 07/13] 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 08/13] 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 09/13] 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 10/13] 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 11/13] 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 12/13] 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 13/13] 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": [