diff --git a/.circleci/config.yml b/.circleci/config.yml index a7cae9785e..9d0791cd7e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -105,6 +105,7 @@ jobs: steps: - checkout - run: npm install + - run: npm run downloadsolc_assets - run: npx nx build remix-ide --with-deps - run: name: Download Selenium @@ -171,6 +172,7 @@ jobs: steps: - checkout - run: npm install + - run: npm run downloadsolc_assets - run: npx nx build remix-ide --with-deps - run: name: Download Selenium diff --git a/apps/debugger/src/app/debugger-api.ts b/apps/debugger/src/app/debugger-api.ts index 2b5a149d16..ae75599bec 100644 --- a/apps/debugger/src/app/debugger-api.ts +++ b/apps/debugger/src/app/debugger-api.ts @@ -62,6 +62,10 @@ export const DebuggerApiMixin = (Base) => class extends Base { this.onEditorContentChangedListener = listener } + onEnvChanged (listener) { + this.onEnvChangedListener = listener + } + onDebugRequested (listener) { this.onDebugRequestedListener = listener } @@ -126,6 +130,7 @@ export const DebuggerApiMixin = (Base) => class extends Base { this.on('editor', 'breakpointCleared', (fileName, row) => { if (this.onBreakpointClearedListener) this.onBreakpointClearedListener(fileName, row) }) this.on('editor', 'breakpointAdded', (fileName, row) => { if (this.onBreakpointAddedListener) this.onBreakpointAddedListener(fileName, row) }) this.on('editor', 'contentChanged', () => { if (this.onEditorContentChangedListener) this.onEditorContentChangedListener() }) + this.on('network', 'providerChanged', (provider) => { if (this.onEnvChangedListener) this.onEnvChangedListener(provider) }) } onDeactivation () { diff --git a/apps/debugger/src/app/debugger.ts b/apps/debugger/src/app/debugger.ts index 95712fb2ac..6255a52205 100644 --- a/apps/debugger/src/app/debugger.ts +++ b/apps/debugger/src/app/debugger.ts @@ -1,7 +1,7 @@ import { PluginClient } from "@remixproject/plugin"; import { createClient } from "@remixproject/plugin-webview"; import { IDebuggerApi, RawLocation, Sources, Asts, LineColumnLocation, - onBreakpointClearedListener, onBreakpointAddedListener, onEditorContentChanged, TransactionReceipt } from '@remix-ui/debugger-ui' + onBreakpointClearedListener, onBreakpointAddedListener, onEditorContentChanged, onEnvChangedListener, TransactionReceipt } from '@remix-ui/debugger-ui' import { DebuggerApiMixin, CompilerAbstract} from './debugger-api' export class DebuggerClientApi extends DebuggerApiMixin(PluginClient) { @@ -18,6 +18,7 @@ export class DebuggerClientApi extends DebuggerApiMixin(PluginClient) { onBreakpointCleared: (listener: onBreakpointClearedListener) => void onBreakpointAdded: (listener: onBreakpointAddedListener) => void onEditorContentChanged: (listener: onEditorContentChanged) => void + onEnvChanged: (listener: onEnvChangedListener) => void discardHighlight: () => Promise highlight: (lineColumnPos: LineColumnLocation, path: string) => Promise fetchContractAndCompile: (address: string, currentReceipt: TransactionReceipt) => Promise diff --git a/apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts b/apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts index 2c3a43ebc4..a46781eaea 100644 --- a/apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts +++ b/apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts @@ -166,27 +166,41 @@ module.exports = { .verify.attributeEquals('*[data-id="uiPathInput"]', 'value', 'tests') }, - 'Solidity Unittests': function (browser: NightwatchBrowser) { - runTests(browser) - } -} + 'Solidity Unit tests Basic': function (browser: NightwatchBrowser) { + browser + .waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]') + .clickLaunchIcon('filePanel') + .click('*[data-id="treeViewLitreeViewItemcontracts"]') + .openFile('contracts/3_Ballot.sol') + .clickLaunchIcon('solidityUnitTesting') + .pause(2000) + .verify.attributeEquals('*[data-id="uiPathInput"]', 'value', 'tests') + .scrollAndClick('#runTestsTabRunAction') + .waitForElementVisible('*[data-id="testTabSolidityUnitTestsOutputheader"]', 120000) + .waitForElementPresent('#solidityUnittestsOutput div[class^="testPass"]', 60000) + .waitForElementContainsText('#solidityUnittestsOutput', '/tests/4_Ballot_test.sol', 60000) + .waitForElementContainsText('#solidityUnittestsOutput', '✓ Check winning proposal', 60000) + .waitForElementContainsText('#solidityUnittestsOutput', '✓ Check winnin proposal with return value', 60000) + }, -function runTests (browser: NightwatchBrowser) { - browser - .waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]') - .clickLaunchIcon('filePanel') - .click('*[data-id="treeViewLitreeViewItemcontracts"]') - .openFile('contracts/3_Ballot.sol') - .clickLaunchIcon('solidityUnitTesting') - .pause(2000) - .verify.attributeEquals('*[data-id="uiPathInput"]', 'value', 'tests') - .scrollAndClick('#runTestsTabRunAction') - .waitForElementVisible('*[data-id="testTabSolidityUnitTestsOutputheader"]', 120000) - .waitForElementPresent('#solidityUnittestsOutput div[class^="testPass"]', 60000) - .waitForElementContainsText('#solidityUnittestsOutput', '/tests/4_Ballot_test.sol', 60000) - .waitForElementContainsText('#solidityUnittestsOutput', '✓ Check winning proposal', 60000) - .waitForElementContainsText('#solidityUnittestsOutput', '✓ Check winnin proposal with return value', 60000) - .end() + 'Solidity Unit tests Basic Basic with local compiler': function (browser: NightwatchBrowser) { + browser + .clickLaunchIcon('solidity') + .setSolidityCompilerVersion('builtin') + .openFile('contracts/3_Ballot.sol') + .clickLaunchIcon('pluginManager') + .scrollAndClick('[data-id="pluginManagerComponentDeactivateButtonsolidityUnitTesting"]') + .pause(2000) + .scrollAndClick('[data-id="pluginManagerComponentActivateButtonsolidityUnitTesting"]') + .clickLaunchIcon('solidityUnitTesting') + .scrollAndClick('#runTestsTabRunAction') + .waitForElementVisible('*[data-id="testTabSolidityUnitTestsOutputheader"]', 120000) + .waitForElementPresent('#solidityUnittestsOutput div[class^="testPass"]', 60000) + .waitForElementContainsText('#solidityUnittestsOutput', '/tests/4_Ballot_test.sol', 60000) + .waitForElementContainsText('#solidityUnittestsOutput', '✓ Check winning proposal', 60000) + .waitForElementContainsText('#solidityUnittestsOutput', '✓ Check winnin proposal with return value', 60000) + .end() + } } const sources = [ diff --git a/apps/remix-ide/src/app/tabs/test-tab.js b/apps/remix-ide/src/app/tabs/test-tab.js index 6750efde55..030745e5d1 100644 --- a/apps/remix-ide/src/app/tabs/test-tab.js +++ b/apps/remix-ide/src/app/tabs/test-tab.js @@ -278,6 +278,8 @@ module.exports = class TestTab extends ViewPlugin { `) } + } else if (result.type === 'logOnly') { + if (result.hhLogs && result.hhLogs.length) this.printHHLogs(result.hhLogs, result.value) } } diff --git a/apps/remix-ide/src/blockchain/providers/injected.js b/apps/remix-ide/src/blockchain/providers/injected.js index 074fcfbf2a..f1272dc058 100644 --- a/apps/remix-ide/src/blockchain/providers/injected.js +++ b/apps/remix-ide/src/blockchain/providers/injected.js @@ -12,7 +12,7 @@ class InjectedProvider { newAccount (passwordPromptCb, cb) { passwordPromptCb((passphrase) => { - this.executionContext.web3().personal.newAccount(passphrase, cb) + this.executionContext.web3().eth.personal.newAccount(passphrase, cb) }) } diff --git a/apps/remix-ide/src/blockchain/providers/node.js b/apps/remix-ide/src/blockchain/providers/node.js index abe407c3f3..b62158ec69 100644 --- a/apps/remix-ide/src/blockchain/providers/node.js +++ b/apps/remix-ide/src/blockchain/providers/node.js @@ -10,7 +10,7 @@ class NodeProvider { getAccounts (cb) { if (this.config.get('settings/personal-mode')) { - return this.executionContext.web3().personal.getListAccounts(cb) + return this.executionContext.web3().eth.personal.getAccounts(cb) } return this.executionContext.web3().eth.getAccounts(cb) } @@ -20,7 +20,7 @@ class NodeProvider { return cb('Not running in personal mode') } passwordPromptCb((passphrase) => { - this.executionContext.web3().personal.newAccount(passphrase, cb) + this.executionContext.web3().eth.personal.newAccount(passphrase, cb) }) } diff --git a/libs/remix-analyzer/package.json b/libs/remix-analyzer/package.json index 07cc68cce7..5c8c540cd6 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.14", + "version": "0.5.15", "description": "Tool to perform static analysis on Solidity smart contracts", "main": "index.js", "types": ".index.d.ts", @@ -23,7 +23,7 @@ "@ethereumjs/tx": "^3.3.0", "@ethereumjs/vm": "^5.5.0", "@remix-project/remix-astwalker": "^0.0.26", - "@remix-project/remix-lib": "^0.5.5", + "@remix-project/remix-lib": "^0.5.6", "async": "^2.6.2", "ethereumjs-util": "^7.0.10", "ethers": "^5.4.2", @@ -51,5 +51,5 @@ "typescript": "^3.7.5" }, "typings": "index.d.ts", - "gitHead": "df7abe1c219e361a947031d620f4ae6e3786a4d7" + "gitHead": "39700b7c076d53d0f857f341774a8448ea5c8da9" } \ No newline at end of file diff --git a/libs/remix-astwalker/package.json b/libs/remix-astwalker/package.json index c8e1b4d1fb..9cad741559 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.35", + "version": "0.0.36", "description": "Tool to walk through Solidity AST", "main": "index.js", "scripts": { @@ -37,7 +37,7 @@ "@ethereumjs/block": "^3.4.0", "@ethereumjs/tx": "^3.3.0", "@ethereumjs/vm": "^5.5.0", - "@remix-project/remix-lib": "^0.5.5", + "@remix-project/remix-lib": "^0.5.6", "@types/tape": "^4.2.33", "async": "^2.6.2", "ethereumjs-util": "^7.0.10", @@ -53,5 +53,5 @@ "tap-spec": "^5.0.0" }, "typings": "index.d.ts", - "gitHead": "df7abe1c219e361a947031d620f4ae6e3786a4d7" + "gitHead": "39700b7c076d53d0f857f341774a8448ea5c8da9" } \ No newline at end of file diff --git a/libs/remix-debug/package.json b/libs/remix-debug/package.json index 105a423a65..33b2d1cd6c 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.5", + "version": "0.5.6", "description": "Tool to debug Ethereum transactions", "contributors": [ { @@ -23,7 +23,7 @@ "@ethereumjs/tx": "^3.3.0", "@ethereumjs/vm": "^5.5.0", "@remix-project/remix-astwalker": "^0.0.26", - "@remix-project/remix-lib": "^0.5.5", + "@remix-project/remix-lib": "^0.5.6", "async": "^2.6.2", "commander": "^2.19.0", "deep-equal": "^1.0.1", @@ -61,5 +61,5 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-debug#readme", "typings": "src/index.d.ts", - "gitHead": "df7abe1c219e361a947031d620f4ae6e3786a4d7" + "gitHead": "39700b7c076d53d0f857f341774a8448ea5c8da9" } \ No newline at end of file diff --git a/libs/remix-lib/package.json b/libs/remix-lib/package.json index fd868cb7d0..fa3c16e30c 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.5", + "version": "0.5.6", "description": "Library to various Remix tools", "contributors": [ { @@ -53,5 +53,5 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-lib#readme", "typings": "src/index.d.ts", - "gitHead": "df7abe1c219e361a947031d620f4ae6e3786a4d7" + "gitHead": "39700b7c076d53d0f857f341774a8448ea5c8da9" } \ No newline at end of file diff --git a/libs/remix-simulator/package.json b/libs/remix-simulator/package.json index 98c1b3d695..1f899f5751 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.5", + "version": "0.2.6", "description": "Ethereum IDE and tools for the web", "contributors": [ { @@ -18,7 +18,7 @@ "@ethereumjs/common": "^2.2.0", "@ethereumjs/tx": "^3.3.0", "@ethereumjs/vm": "^5.5.0", - "@remix-project/remix-lib": "^0.5.5", + "@remix-project/remix-lib": "^0.5.6", "ansi-gray": "^0.1.1", "async": "^3.1.0", "body-parser": "^1.18.2", @@ -66,5 +66,5 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-simulator#readme", "typings": "src/index.d.ts", - "gitHead": "df7abe1c219e361a947031d620f4ae6e3786a4d7" + "gitHead": "39700b7c076d53d0f857f341774a8448ea5c8da9" } \ No newline at end of file diff --git a/libs/remix-solidity/package.json b/libs/remix-solidity/package.json index 6e6f38bdf3..c7b002f939 100644 --- a/libs/remix-solidity/package.json +++ b/libs/remix-solidity/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-solidity", - "version": "0.4.5", + "version": "0.4.6", "description": "Tool to load and run Solidity compiler", "main": "index.js", "types": "./index.d.ts", @@ -18,7 +18,7 @@ "@ethereumjs/block": "^3.4.0", "@ethereumjs/tx": "^3.3.0", "@ethereumjs/vm": "^5.5.0", - "@remix-project/remix-lib": "^0.5.5", + "@remix-project/remix-lib": "^0.5.6", "async": "^2.6.2", "eslint-scope": "^5.0.0", "ethereumjs-util": "^7.0.10", @@ -59,5 +59,5 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-solidity#readme", "typings": "index.d.ts", - "gitHead": "df7abe1c219e361a947031d620f4ae6e3786a4d7" + "gitHead": "39700b7c076d53d0f857f341774a8448ea5c8da9" } \ No newline at end of file diff --git a/libs/remix-solidity/src/compiler/compiler-utils.ts b/libs/remix-solidity/src/compiler/compiler-utils.ts index da3bc487b3..7e19ae7d8a 100644 --- a/libs/remix-solidity/src/compiler/compiler-utils.ts +++ b/libs/remix-solidity/src/compiler/compiler-utils.ts @@ -12,9 +12,21 @@ export const pathToURL = {} * @param version is the version of compiler with or without 'soljson-v' prefix and .js postfix */ export function urlFromVersion (version) { - if (!version.startsWith('soljson-v')) version = 'soljson-v' + version - if (!version.endsWith('.js')) version = version + '.js' - return `${pathToURL[version]}/${version}` + let url + if (version === 'builtin') { + let location: string | Location = window.document.location + let path = location.pathname + if (!path.startsWith('/')) path = '/' + path + location = `${location.protocol}//${location.host}${path}assets/js` + if (location.endsWith('index.html')) location = location.substring(0, location.length - 10) + if (!location.endsWith('/')) location += '/' + url = `${location}soljson.js` + } else { + if (!version.startsWith('soljson-v')) version = 'soljson-v' + version + if (!version.endsWith('.js')) version = version + '.js' + url = `${pathToURL[version]}/${version}` + } + return url } /** diff --git a/libs/remix-tests/package.json b/libs/remix-tests/package.json index bf1ea69207..86c199618c 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.5", + "version": "0.2.6", "description": "Tool to test Solidity smart contracts", "main": "src/index.js", "types": "./src/index.d.ts", @@ -39,9 +39,9 @@ "@ethereumjs/common": "^2.2.0", "@ethereumjs/tx": "^3.3.0", "@ethereumjs/vm": "^5.5.0", - "@remix-project/remix-lib": "^0.5.5", - "@remix-project/remix-simulator": "^0.2.5", - "@remix-project/remix-solidity": "^0.4.5", + "@remix-project/remix-lib": "^0.5.6", + "@remix-project/remix-simulator": "^0.2.6", + "@remix-project/remix-solidity": "^0.4.6", "ansi-gray": "^0.1.1", "async": "^2.6.0", "axios": ">=0.21.1", @@ -77,5 +77,5 @@ "typescript": "^3.3.1" }, "typings": "src/index.d.ts", - "gitHead": "df7abe1c219e361a947031d620f4ae6e3786a4d7" + "gitHead": "39700b7c076d53d0f857f341774a8448ea5c8da9" } \ No newline at end of file diff --git a/libs/remix-tests/src/testRunner.ts b/libs/remix-tests/src/testRunner.ts index 47b44d708b..ffc2cecde4 100644 --- a/libs/remix-tests/src/testRunner.ts +++ b/libs/remix-tests/src/testRunner.ts @@ -244,8 +244,15 @@ export function runTest (testName: string, testObject: any, contractDetails: Com const method = testObject.methods[func.name].apply(testObject.methods[func.name], []) const startTime = Date.now() if (func.constant) { - method.call(sendParams).then((result) => { + sendParams = {} + const tagTimestamp = 'remix_tests_tag' + Date.now() + sendParams.timestamp = tagTimestamp + method.call(sendParams).then(async (result) => { const time = (Date.now() - startTime) / 1000.0 + let tagTxHash + let hhLogs + if (web3.eth && web3.eth.getHashFromTagBySimulator) tagTxHash = await web3.eth.getHashFromTagBySimulator(tagTimestamp) + if (web3.eth && web3.eth.getHHLogsForTx) hhLogs = await web3.eth.getHHLogsForTx(tagTxHash) if (result) { const resp: TestResultInterface = { type: 'testPass', @@ -254,6 +261,7 @@ export function runTest (testName: string, testObject: any, contractDetails: Com time: time, context: testName } + if (hhLogs) resp.hhLogs = hhLogs testCallback(undefined, resp) passingNum += 1 timePassed += time @@ -266,6 +274,7 @@ export function runTest (testName: string, testObject: any, contractDetails: Com errMsg: 'function returned false', context: testName } + if (hhLogs) resp.hhLogs = hhLogs testCallback(undefined, resp) failureNum += 1 timePassed += time @@ -338,6 +347,17 @@ export function runTest (testName: string, testObject: any, contractDetails: Com testCallback(undefined, resp) passingNum += 1 timePassed += time + } else if (hhLogs) { + const resp: TestResultInterface = { + type: 'logOnly', + value: changeCase.sentenceCase(func.name), + filename: testObject.filename, + time: time, + context: testName, + hhLogs + } + testCallback(undefined, resp) + timePassed += time } return next() diff --git a/libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx b/libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx index 0def604fdc..e79ad8910c 100644 --- a/libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx +++ b/libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx @@ -31,7 +31,8 @@ export const DebuggerUI = (props: DebuggerUIProps) => { }, toastMessage: '', validationError: '', - txNumberIsEmpty: true + txNumberIsEmpty: true, + isLocalNodeUsed: false }) useEffect(() => { @@ -62,6 +63,17 @@ export const DebuggerUI = (props: DebuggerUIProps) => { } setEditor() + + const providerChanged = () => { + debuggerModule.onEnvChanged((provider) => { + setState(prevState => { + const isLocalNodeUsed = provider !== 'vm' && provider !== 'injected' + return { ...prevState, isLocalNodeUsed: isLocalNodeUsed } + }) + }) + } + + providerChanged() }, [state.debugger]) const listenToEvents = (debuggerInstance, currentReceipt) => { @@ -289,7 +301,7 @@ export const DebuggerUI = (props: DebuggerUIProps) => { }} type="checkbox" title="Debug with generated sources" /> -
+ { state.isLocalNodeUsed &&
{ setState(prevState => { return { ...prevState, opt: { ...prevState.opt, debugWithLocalNode: checked } } @@ -297,6 +309,7 @@ export const DebuggerUI = (props: DebuggerUIProps) => { }} type="checkbox" title="Force the debugger to use the current local node" />
+ } { state.validationError && {state.validationError} }
diff --git a/libs/remix-ui/debugger-ui/src/lib/idebugger-api.ts b/libs/remix-ui/debugger-ui/src/lib/idebugger-api.ts index 4e31ce7360..2e57aff5a6 100644 --- a/libs/remix-ui/debugger-ui/src/lib/idebugger-api.ts +++ b/libs/remix-ui/debugger-ui/src/lib/idebugger-api.ts @@ -46,6 +46,7 @@ export type onBreakpointClearedListener = (params: string, row: number) => void export type onBreakpointAddedListener = (params: string, row: number) => void export type onEditorContentChanged = () => void export type onDebugRequested = (hash: string) => void +export type onEnvChangedListener = (provider: string) => void export interface IDebuggerApi { offsetToLineColumnConverter: { offsetToLineColumn: (sourceLocation: RawLocation, file: number, contents: Sources, asts: Asts) => Promise } @@ -57,6 +58,7 @@ export interface IDebuggerApi { onBreakpointCleared: (listener: onBreakpointClearedListener) => void onBreakpointAdded: (listener: onBreakpointAddedListener) => void onEditorContentChanged: (listener: onEditorContentChanged) => void + onEnvChanged: (listener: onEnvChangedListener) => void discardHighlight: () => Promise highlight: (lineColumnPos: LineColumnLocation, path: string) => Promise fetchContractAndCompile: (address: string, currentReceipt: TransactionReceipt) => Promise diff --git a/libs/remix-ui/debugger-ui/src/lib/vm-debugger/global-variables.tsx b/libs/remix-ui/debugger-ui/src/lib/vm-debugger/global-variables.tsx index db26cf980b..98713182cd 100644 --- a/libs/remix-ui/debugger-ui/src/lib/vm-debugger/global-variables.tsx +++ b/libs/remix-ui/debugger-ui/src/lib/vm-debugger/global-variables.tsx @@ -5,7 +5,6 @@ import { BN } from 'ethereumjs-util' export const GlobalVariables = ({ block, receipt, tx }) => { // see https://docs.soliditylang.org/en/latest/units-and-global-variables.html#block-and-transaction-properties const globals = { - 'block.basefee': (new BN(block.baseFeePerGas.replace('0x', ''), 'hex')).toString(10) + ` Wei (${block.baseFeePerGas})`, 'block.chainid': tx.chainId, 'block.coinbase': block.miner, 'block.difficulty': block.difficulty, @@ -17,6 +16,10 @@ export const GlobalVariables = ({ block, receipt, tx }) => { 'msg.value': tx.value + ' Wei', 'tx.origin': tx.from } + if (block.baseFeePerGas) { + globals['block.basefee'] = (new BN(block.baseFeePerGas.replace('0x', ''), 'hex')).toString(10) + ` Wei (${block.baseFeePerGas})` + } + return (
diff --git a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx index 9469121adf..80b1004ab6 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx @@ -333,19 +333,15 @@ export const CompilerContainer = (props: CompilerContainerProps) => { updateCurrentVersion(selectedVersion) url = customUrl api.setParameters({ version: selectedVersion }) - } else if (selectedVersion === 'builtin') { - let location: string | Location = window.document.location - let path = location.pathname - if (!path.startsWith('/')) path = '/' + path - location = `${location.protocol}//${location.host}${path}assets/js` - if (location.endsWith('index.html')) location = location.substring(0, location.length - 10) - if (!location.endsWith('/')) location += '/' - url = location + 'soljson.js' } else { - if (selectedVersion.indexOf('soljson') !== 0 || helper.checkSpecialChars(selectedVersion)) { - return console.log('loading ' + selectedVersion + ' not allowed') + if (helper.checkSpecialChars(selectedVersion)) { + return console.log('loading ' + selectedVersion + ' not allowed, special chars not allowed.') + } + if (selectedVersion === 'builtin' || selectedVersion.indexOf('soljson') === 0) { + url = urlFromVersion(selectedVersion) + } else { + return console.log('loading ' + selectedVersion + ' not allowed, version should start with "soljson"') } - url = `${urlFromVersion(selectedVersion)}` } // Workers cannot load js on "file:"-URLs and we get a diff --git a/libs/remix-url-resolver/package.json b/libs/remix-url-resolver/package.json index a9b6770890..00bd82df23 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.26", + "version": "0.0.27", "description": "Solidity import url resolver engine", "main": "index.js", "types": "./index.d.ts", @@ -42,5 +42,5 @@ "typescript": "^3.1.6" }, "typings": "index.d.ts", - "gitHead": "df7abe1c219e361a947031d620f4ae6e3786a4d7" + "gitHead": "39700b7c076d53d0f857f341774a8448ea5c8da9" } \ No newline at end of file diff --git a/libs/remixd/package.json b/libs/remixd/package.json index 6f9123c651..3cb0baddd7 100644 --- a/libs/remixd/package.json +++ b/libs/remixd/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remixd", - "version": "0.5.0", + "version": "0.5.1", "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", diff --git a/package-lock.json b/package-lock.json index d3372b8379..dc010b4ac4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "remix-project", - "version": "0.17.0-dev", + "version": "0.18.0-dev", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -3553,6 +3553,12 @@ "@fortawesome/fontawesome-common-types": "^0.2.34" } }, + "@gar/promisify": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.2.tgz", + "integrity": "sha512-82cpyJyKRoQoRi+14ibCeGPu0CwypgtBAdBhq1WfvagpCZNKqwXbKwXllYSMG91DhmG4jt9gN8eP6lGOtozuaw==", + "dev": true + }, "@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -5886,6 +5892,42 @@ "integrity": "sha512-oN3y7FAROHhrAt7Rr7PnTSwrHrZVRTS2ZbyxeQwSSYD0ifwM3YNgQqbaRmjcWoPyq77MjchusjJDspbzMmip1Q==", "dev": true }, + "@npmcli/fs": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-1.0.0.tgz", + "integrity": "sha512-8ltnOpRR/oJbOp8vaGUnipOi3bqkcW+sLHFlyXIr08OGHmVJLB1Hn7QtGXbYcpVtH1gAYZTlmDXtE4YV0+AMMQ==", + "dev": true, + "requires": { + "@gar/promisify": "^1.0.1", + "semver": "^7.3.5" + }, + "dependencies": { + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } + }, "@npmcli/git": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-2.0.3.tgz", @@ -11344,17 +11386,6 @@ } } }, - "fsevents": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", - "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", - "dev": true, - "optional": true, - "requires": { - "bindings": "^1.5.0", - "nan": "^2.12.1" - } - }, "glob-parent": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", @@ -12175,16 +12206,6 @@ "to-regex-range": "^2.1.0" } }, - "fsevents": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", - "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", - "optional": true, - "requires": { - "bindings": "^1.5.0", - "nan": "^2.12.1" - } - }, "glob-parent": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", @@ -17502,6 +17523,16 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, + "fsevents": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", + "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", + "optional": true, + "requires": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + } + }, "fstream": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", @@ -30236,17 +30267,6 @@ } } }, - "fsevents": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", - "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", - "dev": true, - "optional": true, - "requires": { - "bindings": "^1.5.0", - "nan": "^2.12.1" - } - }, "glob-parent": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", @@ -37033,11 +37053,12 @@ "dev": true }, "cacache": { - "version": "15.2.0", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.2.0.tgz", - "integrity": "sha512-uKoJSHmnrqXgthDFx/IU6ED/5xd+NNGe+Bb+kLZy7Ku4P+BaiWEUflAKPZ7eAzsYGcsAGASJZsybXp+quEcHTw==", + "version": "15.3.0", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz", + "integrity": "sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==", "dev": true, "requires": { + "@npmcli/fs": "^1.0.0", "@npmcli/move-file": "^1.0.1", "chownr": "^2.0.0", "fs-minipass": "^2.0.0", @@ -37064,9 +37085,9 @@ "dev": true }, "find-cache-dir": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", - "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", + "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", "dev": true, "requires": { "commondir": "^1.0.1", @@ -37257,9 +37278,9 @@ } }, "tar": { - "version": "6.1.10", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.10.tgz", - "integrity": "sha512-kvvfiVvjGMxeUNB6MyYv5z7vhfFRwbwCXJAeL0/lnbrttBVqcMOnpHUf0X42LrPMR8mMpgapkJMchFH4FSHzNA==", + "version": "6.1.11", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", + "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", "dev": true, "requires": { "chownr": "^2.0.0", @@ -37271,9 +37292,9 @@ } }, "terser": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.7.1.tgz", - "integrity": "sha512-b3e+d5JbHAe/JSjwsC3Zn55wsBIM7AsHLjKxT31kGCldgbpFePaFo+PiddtO6uwRZWRw7sPXmAN8dTW61xmnSg==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.7.2.tgz", + "integrity": "sha512-0Omye+RD4X7X69O0eql3lC4Heh/5iLj3ggxR/B5ketZLOtLiOqukUgjw3q4PDnNQbsrkKr3UMypqStQG3XKRvw==", "dev": true, "requires": { "commander": "^2.20.0", diff --git a/package.json b/package.json index 0175da3400..2bcbcd0b49 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "remix-project", - "version": "0.17.0-dev", + "version": "0.18.0-dev", "license": "MIT", "description": "Ethereum Remix Monorepo", "keywords": [