diff --git a/apps/remix-ide-e2e/src/examples/example-contracts.ts b/apps/remix-ide-e2e/src/examples/example-contracts.ts index 1247244df0..a02bf6d608 100644 --- a/apps/remix-ide-e2e/src/examples/example-contracts.ts +++ b/apps/remix-ide-e2e/src/examples/example-contracts.ts @@ -1,6 +1,6 @@ 'use strict' -const storage = `pragma solidity >=0.4.22 <0.7.0; +const storage = `pragma solidity >=0.7.0 <0.8.0; /** * @title Storage @@ -27,7 +27,7 @@ contract Storage { } }` -const owner = `pragma solidity >=0.4.22 <0.7.0; +const owner = `pragma solidity >=0.7.0 <0.8.0; /** * @title Owner @@ -54,7 +54,7 @@ contract Owner { /** * @dev Set contract deployer as owner */ - constructor() public { + constructor() { owner = msg.sender; // 'msg.sender' is sender of current call, contract deployer for a constructor emit OwnerSet(address(0), owner); } @@ -77,7 +77,7 @@ contract Owner { } }` -const ballot = `pragma solidity >=0.4.22 <0.7.0; +const ballot = `pragma solidity >=0.7.0 <0.8.0; /** * @title Ballot @@ -109,7 +109,7 @@ contract Ballot { * @dev Create a new ballot to choose one of 'proposalNames'. * @param proposalNames names of proposals */ - constructor(bytes32[] memory proposalNames) public { + constructor(bytes32[] memory proposalNames) { chairperson = msg.sender; voters[chairperson].weight = 1; @@ -281,7 +281,7 @@ contract Ballot { } }` -const ballotTest = `pragma solidity >=0.4.22 <0.7.0; +const ballotTest = `pragma solidity >=0.4.22 <0.8.0; import "remix_tests.sol"; // this import is automatically injected by Remix. import "../3_Ballot.sol"; diff --git a/apps/remix-ide-e2e/src/tests/debugger.test.ts b/apps/remix-ide-e2e/src/tests/debugger.test.ts index f95ae93049..93bbae00f2 100644 --- a/apps/remix-ide-e2e/src/tests/debugger.test.ts +++ b/apps/remix-ide-e2e/src/tests/debugger.test.ts @@ -16,7 +16,7 @@ module.exports = { 'Should launch debugger': function (browser: NightwatchBrowser) { browser.addFile('blah.sol', sources[0]['browser/blah.sol']) .clickLaunchIcon('udapp') - .waitForElementPresent('*[title="Deploy - transact (not payable)"]') + .waitForElementPresent('*[title="Deploy - transact (not payable)"]', 45000) .click('*[title="Deploy - transact (not payable)"]') .debugTransaction(0) .assert.containsText('*[data-id="sidePanelSwapitTitle"]', 'DEBUGGER') @@ -78,8 +78,10 @@ module.exports = { browser .clickLaunchIcon('solidity') .setSolidityCompilerVersion('soljson-v0.6.12+commit.27d51765.js') - .clickLaunchIcon('udapp') + .pause(2000) + .clickLaunchIcon('udapp') .testContracts('externalImport.sol', sources[1]['browser/externalImport.sol'], ['ERC20']) + .waitForElementPresent('*[title="Deploy - transact (not payable)"]', 35000) .selectContract('ERC20') .createContract('"tokenName", "symbol"') .debugTransaction(2) @@ -134,7 +136,9 @@ module.exports = { 'Should load more solidity locals array': function (browser: NightwatchBrowser) { browser.addFile('locals.sol', sources[3]['browser/locals.sol']) .clickLaunchIcon('udapp') + .waitForElementPresent('*[title="Deploy - transact (not payable)"]', 40000) .createContract('') + .pause(2000) .clickInstance(3) .clickFunction('t - transact (not payable)') .pause(2000) @@ -154,7 +158,8 @@ module.exports = { browser .clickLaunchIcon('solidity') .setSolidityCompilerVersion('soljson-v0.7.2+commit.51b20bc0.js') - .clickLaunchIcon('udapp') + .clickLaunchIcon('udapp') + .pause(2000) .testContracts('withGeneratedSources.sol', sources[4]['browser/withGeneratedSources.sol'], ['A']) .createContract('') .clickInstance(4) @@ -178,7 +183,7 @@ const sources = [ { 'browser/blah.sol': { content: ` - pragma solidity >=0.4.22 <0.6.0; + pragma solidity >=0.7.0 <0.8.0; contract Kickstarter { @@ -193,7 +198,7 @@ const sources = [ Project[] public projects; - constructor() public { + constructor() { } @@ -236,7 +241,7 @@ const sources = [ { 'browser/locals.sol': { content: ` - pragma solidity ^0.6.0; + pragma solidity ^0.7.0; contract test { function t () public { uint[] memory array = new uint[](150); diff --git a/apps/remix-ide-e2e/src/tests/fileManager_api.test.ts b/apps/remix-ide-e2e/src/tests/fileManager_api.test.ts index f9416e4cff..ea48ae6f47 100644 --- a/apps/remix-ide-e2e/src/tests/fileManager_api.test.ts +++ b/apps/remix-ide-e2e/src/tests/fileManager_api.test.ts @@ -55,7 +55,7 @@ module.exports = { .addFile('copyFile.js', { content: executeCopyFile }) .executeScript(`remix.exeCurrent()`) .pause(2000) - .journalLastChildIncludes('pragma solidity >=0.4.22 <0.7.0;') + .journalLastChildIncludes('pragma solidity >=0.7.0 <0.8.0;') }, 'Should execute `rename` api from file manager external api': function (browser: NightwatchBrowser) { diff --git a/apps/remix-ide-e2e/src/tests/runAndDeploy.ts b/apps/remix-ide-e2e/src/tests/runAndDeploy.ts index ce3d664b99..532fbd2027 100644 --- a/apps/remix-ide-e2e/src/tests/runAndDeploy.ts +++ b/apps/remix-ide-e2e/src/tests/runAndDeploy.ts @@ -44,12 +44,12 @@ module.exports = { .addFile('Greet.sol', sources[0]['browser/Greet.sol']) .clickLaunchIcon('udapp') .selectAccount('0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c') - .waitForElementPresent('*[data-id="Deploy - transact (not payable)"]') + .waitForElementPresent('*[data-id="Deploy - transact (not payable)"]', 45000) .click('*[data-id="Deploy - transact (not payable)"]') .pause(5000) - .testFunction('0xc39ee005c1e1368c84f02e458de4b41dbb966631a8714d15ef8362dada249ede', { + .testFunction('0x82f6c88a909b49d6cc003fb302a6e0184c3f08e942b62e1c95dec326d4c6020b', { status: 'true Transaction mined and execution succeed', - 'transaction hash': '0xc39ee005c1e1368c84f02e458de4b41dbb966631a8714d15ef8362dada249ede' + 'transaction hash': '0x82f6c88a909b49d6cc003fb302a6e0184c3f08e942b62e1c95dec326d4c6020b' }) }, @@ -191,7 +191,7 @@ const sources = [ 'browser/Greet.sol': { content: ` - pragma solidity ^0.6.0; + pragma solidity ^0.7.0; contract helloWorld { string public message; diff --git a/apps/remix-ide-e2e/src/tests/signingMessage.test.ts b/apps/remix-ide-e2e/src/tests/signingMessage.test.ts index 67c405d30a..28a88d3d22 100644 --- a/apps/remix-ide-e2e/src/tests/signingMessage.test.ts +++ b/apps/remix-ide-e2e/src/tests/signingMessage.test.ts @@ -55,7 +55,7 @@ module.exports = { const sources = [ { 'browser/signMassage.sol': {content: ` - pragma solidity >=0.4.22 <0.7.0; + pragma solidity >=0.4.22 <0.8.0; contract SignMassageTest { function testRecovery(bytes32 h, uint8 v, bytes32 r, bytes32 s) public pure returns (address) { return ecrecover(h, v, r, s); diff --git a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts index 80757def5d..512c00a1bd 100644 --- a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts +++ b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts @@ -90,7 +90,7 @@ module.exports = { .scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]') .pause(5000) .click('*[data-id="testTabRunTestsTabStopAction"]') - .pause(1000) + // .pause(1000) .assert.containsText('*[data-id="testTabRunTestsTabStopAction"]', 'Stopping') .waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutputheader"]', 40000) .assert.containsText('*[data-id="testTabSolidityUnitTestsOutput"]', 'browser/tests/ks2b_test.sol') @@ -172,7 +172,7 @@ function runTests (browser: NightwatchBrowser) { .pause(500) .scrollAndClick('#runTestsTabRunAction') .waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutputheader"]', 40000) - .waitForElementPresent('#solidityUnittestsOutput div[class^="testPass"]', 7000) + .waitForElementPresent('#solidityUnittestsOutput div[class^="testPass"]', 10000) .assert.containsText('#solidityUnittestsOutput', 'browser/tests/4_Ballot_test.sol') .assert.containsText('#solidityUnittestsOutput', '✓ Check winning proposal') .assert.containsText('#solidityUnittestsOutput', '✓ Check winnin proposal with return value') @@ -183,12 +183,12 @@ const sources = [ { 'browser/simple_storage.sol': { content: ` - pragma solidity >=0.4.22 <0.7.0; + pragma solidity >=0.4.22 <0.8.0; contract SimpleStorage { uint public storedData; - constructor() public { + constructor() { storedData = 100; } @@ -204,7 +204,7 @@ const sources = [ }, 'browser/tests/simple_storage_test.sol': { content: ` - pragma solidity >=0.4.22 <0.7.0; + pragma solidity >=0.4.22 <0.8.0; import "remix_tests.sol"; import "../simple_storage.sol"; @@ -233,7 +233,7 @@ const sources = [ }, 'browser/ks2a.sol': { content: ` - pragma solidity >=0.4.22 <0.6.0; + pragma solidity >=0.4.22 <0.8.0; contract Kickstarter { enum State { Started, Completed } @@ -246,14 +246,14 @@ const sources = [ State state; mapping(address => uint) funders; // added } - + uint numProjects; Project[] public projects; - constructor() public { + constructor() { } function createProject(string memory name, uint goal) public { - projects.length++; // new line + projects.push(); // new line Project storage project = projects[projects.length - 1]; project.name = name; project.goal = goal; @@ -287,7 +287,7 @@ const sources = [ }, 'browser/tests/ks2b_test.sol': { content: ` - pragma solidity >=0.4.22 <0.6.0; + pragma solidity >=0.4.22 <0.8.0; pragma experimental ABIEncoderV2; import "remix_tests.sol"; // this import is automatically injected by Remix. @@ -336,7 +336,7 @@ const sources = [ } function checkProjectIsFundable () public { - kickstarter.fundProject.value(120000)(0); + kickstarter.fundProject{value:120000}(0); (address owner, string memory name, uint goal, uint fundsAvailable, uint amountContributed, Kickstarter.State state) = kickstarter.projects(0); Assert.equal(amountContributed, 120000, "contributed amount is incorrect"); } @@ -346,7 +346,7 @@ const sources = [ }, 'browser/compilationError_test.sol': { content: ` - pragma solidity ^0.6.1; + pragma solidity ^0.7.0; contract failOnCompilation { fallback() { @@ -357,10 +357,10 @@ const sources = [ }, 'browser/tests/deployError_test.sol': { content: ` - pragma solidity ^0.6.0; + pragma solidity ^0.7.0; contract failingDeploy { - constructor() public { + constructor() { revert('Deploy Failed'); } } @@ -368,7 +368,7 @@ const sources = [ }, 'browser/tests/methodFailure_test.sol': { content: ` - pragma solidity ^0.6.0; + pragma solidity ^0.7.0; contract methodfailure { function add(uint a, uint b) public { diff --git a/apps/remix-ide-e2e/src/tests/staticAnalysis.test.ts b/apps/remix-ide-e2e/src/tests/staticAnalysis.test.ts index c7c37043d2..cf8750f159 100644 --- a/apps/remix-ide-e2e/src/tests/staticAnalysis.test.ts +++ b/apps/remix-ide-e2e/src/tests/staticAnalysis.test.ts @@ -6,12 +6,12 @@ import sauce from './sauce' const sources = [ { 'browser/Untitled.sol': {content: ` -pragma solidity >=0.4.22 <0.6.0; +pragma solidity >=0.6.0 <0.8.0; contract test1 { address test = tx.origin; } contract test2 {} contract TooMuchGas { uint x; - function() external { + fallback() external { x++; uint test; uint test1; @@ -36,6 +36,7 @@ function runTests (browser: NightwatchBrowser) { browser .waitForElementVisible('#icon-panel', 10000) .clickLaunchIcon('solidity') + .pause(10000) .testContracts('Untitled.sol', sources[0]['browser/Untitled.sol'], ['TooMuchGas', 'test1', 'test2']) .clickLaunchIcon('solidityStaticAnalysis') .click('#staticanalysisView button') diff --git a/apps/remix-ide/ci/makeMockCompiler.js b/apps/remix-ide/ci/makeMockCompiler.js index 5ad561ede7..155331d4cf 100644 --- a/apps/remix-ide/ci/makeMockCompiler.js +++ b/apps/remix-ide/ci/makeMockCompiler.js @@ -3,7 +3,7 @@ var fs = require('fs') var compiler = require('solc') var compilerInput = require('@remix-project/remix-solidity').CompilerInput -var defaultVersion = 'v0.6.6+commit.6c089d02' +var defaultVersion = 'v0.7.4+commit.3f05b770' const path = require('path') compiler.loadRemoteVersion(defaultVersion, (error, solcSnapshot) => { diff --git a/apps/remix-ide/src/app/editor/example-contracts.js b/apps/remix-ide/src/app/editor/example-contracts.js index a825255904..bbf637f8e4 100644 --- a/apps/remix-ide/src/app/editor/example-contracts.js +++ b/apps/remix-ide/src/app/editor/example-contracts.js @@ -1,6 +1,6 @@ 'use strict' -const storage = `pragma solidity >=0.4.22 <0.7.0; +const storage = `pragma solidity >=0.7.0 <0.8.0; /** * @title Storage @@ -27,7 +27,7 @@ contract Storage { } }` -const owner = `pragma solidity >=0.4.22 <0.7.0; +const owner = `pragma solidity >=0.7.0 <0.8.0; /** * @title Owner @@ -54,7 +54,7 @@ contract Owner { /** * @dev Set contract deployer as owner */ - constructor() public { + constructor() { owner = msg.sender; // 'msg.sender' is sender of current call, contract deployer for a constructor emit OwnerSet(address(0), owner); } @@ -77,7 +77,7 @@ contract Owner { } }` -const ballot = `pragma solidity >=0.4.22 <0.7.0; +const ballot = `pragma solidity >=0.7.0 <0.8.0; /** * @title Ballot @@ -109,7 +109,7 @@ contract Ballot { * @dev Create a new ballot to choose one of 'proposalNames'. * @param proposalNames names of proposals */ - constructor(bytes32[] memory proposalNames) public { + constructor(bytes32[] memory proposalNames) { chairperson = msg.sender; voters[chairperson].weight = 1; @@ -215,7 +215,7 @@ contract Ballot { } ` -var ballotTest = `pragma solidity >=0.4.22 <0.7.0; +var ballotTest = `pragma solidity >=0.7.0 <0.8.0; import "remix_tests.sol"; // this import is automatically injected by Remix. import "../3_Ballot.sol"; diff --git a/apps/remix-ide/src/app/tabs/compileTab/compilerContainer.js b/apps/remix-ide/src/app/tabs/compileTab/compilerContainer.js index d5b6449d35..a874880d61 100644 --- a/apps/remix-ide/src/app/tabs/compileTab/compilerContainer.js +++ b/apps/remix-ide/src/app/tabs/compileTab/compilerContainer.js @@ -23,7 +23,7 @@ class CompilerContainer { timeout: 300, allversions: null, selectedVersion: null, - defaultVersion: 'soljson-v0.6.6+commit.6c089d02.js' // this default version is defined: in makeMockCompiler (for browser test) and in package.json (downloadsolc_root) for the builtin compiler + defaultVersion: 'soljson-v0.7.4+commit.3f05b770.js' // this default version is defined: in makeMockCompiler (for browser test) and in package.json (downloadsolc_root) for the builtin compiler } } diff --git a/apps/remix-ide/src/app/tabs/testTab/testTab.js b/apps/remix-ide/src/app/tabs/testTab/testTab.js index 964b431337..f0a7399811 100644 --- a/apps/remix-ide/src/app/tabs/testTab/testTab.js +++ b/apps/remix-ide/src/app/tabs/testTab/testTab.js @@ -63,7 +63,7 @@ class TestTabLogic { let relative = remixPath.relative(this.currentPath, remixPath.dirname(fileToImport)) if (relative === '') relative = '.' const comment = hasCurrent ? `import "${relative}/${remixPath.basename(fileToImport)}";` : '// Import here the file to test.' - return `pragma solidity >=0.4.22 <0.7.0; + return `pragma solidity >=0.4.22 <0.8.0; import "remix_tests.sol"; // this import is automatically injected by Remix. ${comment} diff --git a/libs/remix-tests/sol/tests.sol.ts b/libs/remix-tests/sol/tests.sol.ts index b745399b1a..edbe332a3a 100644 --- a/libs/remix-tests/sol/tests.sol.ts +++ b/libs/remix-tests/sol/tests.sol.ts @@ -1,5 +1,5 @@ module.exports = ` -pragma solidity >=0.4.22 <0.7.0; +pragma solidity >=0.4.22 <0.8.0; library Assert { diff --git a/package.json b/package.json index 7b2b5a1eba..3a7af0876c 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "bumpVersion:libs": "gulp; gulp syncLibVersions;", "browsertest": "sleep 5 && npm run nightwatch_local", "csslint": "csslint --ignore=order-alphabetical --errors='errors,duplicate-properties,empty-rules' --exclude-list='apps/remix-ide/assets/css/font-awesome.min.css' apps/remix-ide/assets/css/", - "downloadsolc_root": "wget --no-check-certificate https://solc-bin.ethereum.org/bin/soljson-v0.6.6+commit.6c089d02.js -O ./apps/remix-ide/soljson.js", + "downloadsolc_root": "wget --no-check-certificate https://solc-bin.ethereum.org/bin/soljson-v0.7.4+commit.3f05b770.js -O ./apps/remix-ide/soljson.js", "make-mock-compiler": "node apps/remix-ide/ci/makeMockCompiler.js", "minify": "uglifyjs --in-source-map inline --source-map-inline -c warnings=false", "nightwatch_parallel": "nx build remix-ide-e2e; nx e2e remix-ide-e2e -env=chrome,firefox",