From df2fa6687fb56b8afe0fc2683095859acea1161a Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Thu, 22 Oct 2020 19:16:35 +0530 Subject: [PATCH] contracts updated --- .../src/examples/example-contracts.ts | 14 +++++----- apps/remix-ide-e2e/src/tests/debugger.test.ts | 6 ++--- .../src/tests/signingMessage.test.ts | 2 +- .../src/tests/solidityUnittests.test.ts | 26 +++++++++---------- .../src/tests/staticAnalysis.test.ts | 2 +- .../src/tests/usingWebWorker.test.ts | 4 +-- .../remix-ide/src/app/tabs/testTab/testTab.js | 2 +- libs/remix-debug/test/debugger.js | 4 +-- libs/remix-lib/test/txFormat.js | 6 ++--- libs/remix-tests/sol/tests.sol.ts | 2 +- .../tests/examples_1/simple_storage.sol | 4 +-- .../tests/examples_1/simple_storage_test.sol | 2 +- .../tests/examples_2/simple_storage.sol | 2 +- .../tests/examples_2/simple_storage_test.sol | 2 +- .../tests/examples_3/simple_string.sol | 2 +- .../tests/examples_3/simple_string_test.sol | 2 +- .../remix-tests/tests/examples_4/SafeMath.sol | 2 +- .../tests/examples_4/SafeMathProxy.sol | 2 +- .../tests/examples_4/SafeMath_test.sol | 2 +- .../examples_5/contract/simple_storage.sol | 4 +-- .../tests/examples_5/lib/EvenOdd.sol | 2 +- .../examples_5/test/simple_storage_test.sol | 2 +- libs/remix-tests/tests/number/number_test.sol | 2 +- 23 files changed, 49 insertions(+), 49 deletions(-) diff --git a/apps/remix-ide-e2e/src/examples/example-contracts.ts b/apps/remix-ide-e2e/src/examples/example-contracts.ts index 1247244df0..aa2904d7d5 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.4.22 <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.4.22 <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.4.22 <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 { } ` -const ballot_0_4_11 = `pragma solidity >=0.4.10 <0.7.0; +const ballot_0_4_11 = `pragma solidity >=0.4.10 <0.8.0; contract Ballot { struct Voter { @@ -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..477e513845 100644 --- a/apps/remix-ide-e2e/src/tests/debugger.test.ts +++ b/apps/remix-ide-e2e/src/tests/debugger.test.ts @@ -178,7 +178,7 @@ const sources = [ { 'browser/blah.sol': { content: ` - pragma solidity >=0.4.22 <0.6.0; + pragma solidity >=0.4.22 <0.8.0; contract Kickstarter { @@ -193,7 +193,7 @@ const sources = [ Project[] public projects; - constructor() public { + constructor() { } @@ -236,7 +236,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/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..ddd1190080 100644 --- a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts +++ b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts @@ -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"); } @@ -357,10 +357,10 @@ const sources = [ }, 'browser/tests/deployError_test.sol': { content: ` - pragma solidity ^0.6.0; + pragma solidity ^0.8.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.8.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..9e4fcbdead 100644 --- a/apps/remix-ide-e2e/src/tests/staticAnalysis.test.ts +++ b/apps/remix-ide-e2e/src/tests/staticAnalysis.test.ts @@ -6,7 +6,7 @@ import sauce from './sauce' const sources = [ { 'browser/Untitled.sol': {content: ` -pragma solidity >=0.4.22 <0.6.0; +pragma solidity >=0.4.22 <0.8.0; contract test1 { address test = tx.origin; } contract test2 {} contract TooMuchGas { diff --git a/apps/remix-ide-e2e/src/tests/usingWebWorker.test.ts b/apps/remix-ide-e2e/src/tests/usingWebWorker.test.ts index d5dc8f52cd..f909863f67 100644 --- a/apps/remix-ide-e2e/src/tests/usingWebWorker.test.ts +++ b/apps/remix-ide-e2e/src/tests/usingWebWorker.test.ts @@ -5,14 +5,14 @@ import sauce from './sauce' const sources = [ {'browser/basic.sol': { content: - `pragma solidity >=0.2.0 <0.7.0; + `pragma solidity >=0.2.0 <0.8.0; /** * @title Basic contract */ contract Basic { uint someVar; - constructor() public {} + constructor() {} }` }} ] 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-debug/test/debugger.js b/libs/remix-debug/test/debugger.js index aba3a821db..cd9e723279 100644 --- a/libs/remix-debug/test/debugger.js +++ b/libs/remix-debug/test/debugger.js @@ -8,7 +8,7 @@ var vmCall = require('./vmCall') var Debugger = require('../src/Ethdebugger') var compiler = require('solc') -var ballot = `pragma solidity >=0.4.22 <0.7.0; +var ballot = `pragma solidity >=0.4.22 <0.8.0; /** * @title Ballot @@ -40,7 +40,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) { uint p = 45; chairperson = msg.sender; address addressLocal = msg.sender; // copy of state variable diff --git a/libs/remix-lib/test/txFormat.js b/libs/remix-lib/test/txFormat.js index 9d897d53f4..fc07cd604d 100644 --- a/libs/remix-lib/test/txFormat.js +++ b/libs/remix-lib/test/txFormat.js @@ -376,7 +376,7 @@ const nestedArrayContract = `contract nestedArrayContractTest { } }` -const deploySimpleLib = `pragma solidity >= 0.5.0 < 0.7.0; +const deploySimpleLib = `pragma solidity >= 0.5.0 < 0.8.0; library lib1 { function getEmpty () public { @@ -397,14 +397,14 @@ contract testContractLinkLibrary { } }` -const encodeFunctionCall = `pragma solidity >= 0.5.0 < 0.7.0; +const encodeFunctionCall = `pragma solidity >= 0.5.0 < 0.8.0; contract testContractLinkLibrary { function get (uint _p, string memory _o) public { } }` -const fallbackAndReceiveFunction = `pragma solidity >= 0.5.0 < 0.7.0; +const fallbackAndReceiveFunction = `pragma solidity >= 0.5.0 < 0.8.0; contract fallbackAndReceiveFunctionContract { function get (uint _p, string memory _o) public { 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/libs/remix-tests/tests/examples_1/simple_storage.sol b/libs/remix-tests/tests/examples_1/simple_storage.sol index 402c9b8955..962f48db0d 100644 --- a/libs/remix-tests/tests/examples_1/simple_storage.sol +++ b/libs/remix-tests/tests/examples_1/simple_storage.sol @@ -1,8 +1,8 @@ -pragma solidity >= 0.5.0 < 0.7.0; +pragma solidity >= 0.5.0 < 0.8.0; contract SimpleStorage { uint public storedData; - constructor() public { + constructor() { storedData = 100; } diff --git a/libs/remix-tests/tests/examples_1/simple_storage_test.sol b/libs/remix-tests/tests/examples_1/simple_storage_test.sol index 6e6518c7be..958788563a 100644 --- a/libs/remix-tests/tests/examples_1/simple_storage_test.sol +++ b/libs/remix-tests/tests/examples_1/simple_storage_test.sol @@ -1,4 +1,4 @@ -pragma solidity >= 0.5.0 < 0.7.0; +pragma solidity >= 0.5.0 < 0.8.0; import "./simple_storage.sol"; contract MyTest { diff --git a/libs/remix-tests/tests/examples_2/simple_storage.sol b/libs/remix-tests/tests/examples_2/simple_storage.sol index 7ce910b014..7ee2ffdc6d 100644 --- a/libs/remix-tests/tests/examples_2/simple_storage.sol +++ b/libs/remix-tests/tests/examples_2/simple_storage.sol @@ -1,4 +1,4 @@ -pragma solidity >= 0.5.0 < 0.7.0; +pragma solidity >= 0.5.0 < 0.8.0; contract SimpleStorage { uint public storedData; diff --git a/libs/remix-tests/tests/examples_2/simple_storage_test.sol b/libs/remix-tests/tests/examples_2/simple_storage_test.sol index 68efe17ac3..a0c3a0d6ca 100644 --- a/libs/remix-tests/tests/examples_2/simple_storage_test.sol +++ b/libs/remix-tests/tests/examples_2/simple_storage_test.sol @@ -1,4 +1,4 @@ -pragma solidity >= 0.5.0 < 0.7.0; +pragma solidity >= 0.5.0 < 0.8.0; import "./simple_storage.sol"; contract MyTest { diff --git a/libs/remix-tests/tests/examples_3/simple_string.sol b/libs/remix-tests/tests/examples_3/simple_string.sol index 6daed1d02a..1bc847f984 100644 --- a/libs/remix-tests/tests/examples_3/simple_string.sol +++ b/libs/remix-tests/tests/examples_3/simple_string.sol @@ -1,4 +1,4 @@ -pragma solidity >= 0.5.0 < 0.7.0; +pragma solidity >= 0.5.0 < 0.8.0; contract SimpleString { string public storedData; diff --git a/libs/remix-tests/tests/examples_3/simple_string_test.sol b/libs/remix-tests/tests/examples_3/simple_string_test.sol index a96582b735..3157f53c35 100644 --- a/libs/remix-tests/tests/examples_3/simple_string_test.sol +++ b/libs/remix-tests/tests/examples_3/simple_string_test.sol @@ -1,4 +1,4 @@ -pragma solidity >= 0.5.0 < 0.7.0; +pragma solidity >= 0.5.0 < 0.8.0; import "./simple_string.sol"; contract StringTest { diff --git a/libs/remix-tests/tests/examples_4/SafeMath.sol b/libs/remix-tests/tests/examples_4/SafeMath.sol index 8d262fb1f8..a93aedaf44 100644 --- a/libs/remix-tests/tests/examples_4/SafeMath.sol +++ b/libs/remix-tests/tests/examples_4/SafeMath.sol @@ -1,6 +1,6 @@ // Copyright (c) 2016 Smart Contract Solutions, Inc. -pragma solidity >=0.4.22 <0.7.0; +pragma solidity >=0.4.22 <0.8.0; /** diff --git a/libs/remix-tests/tests/examples_4/SafeMathProxy.sol b/libs/remix-tests/tests/examples_4/SafeMathProxy.sol index 502f5c2ccf..805c6d9112 100644 --- a/libs/remix-tests/tests/examples_4/SafeMathProxy.sol +++ b/libs/remix-tests/tests/examples_4/SafeMathProxy.sol @@ -1,4 +1,4 @@ -pragma solidity >=0.4.22 <0.7.0; +pragma solidity >=0.4.22 <0.8.0; import "./SafeMath.sol"; /* diff --git a/libs/remix-tests/tests/examples_4/SafeMath_test.sol b/libs/remix-tests/tests/examples_4/SafeMath_test.sol index 72be6b2f17..aa5112dc64 100644 --- a/libs/remix-tests/tests/examples_4/SafeMath_test.sol +++ b/libs/remix-tests/tests/examples_4/SafeMath_test.sol @@ -1,4 +1,4 @@ -pragma solidity >=0.4.22 <0.7.0; +pragma solidity >=0.4.22 <0.8.0; import "remix_tests.sol"; import "./SafeMath.sol"; import "./SafeMathProxy.sol"; diff --git a/libs/remix-tests/tests/examples_5/contract/simple_storage.sol b/libs/remix-tests/tests/examples_5/contract/simple_storage.sol index ec8d01ad2c..ebc18f96cc 100644 --- a/libs/remix-tests/tests/examples_5/contract/simple_storage.sol +++ b/libs/remix-tests/tests/examples_5/contract/simple_storage.sol @@ -1,4 +1,4 @@ -pragma solidity >= 0.5.0 < 0.7.0; +pragma solidity >= 0.5.0 < 0.8.0; import "../../examples_4/SafeMath.sol"; import "../lib/EvenOdd.sol"; @@ -7,7 +7,7 @@ contract SimpleStorage is EvenOdd{ using SafeMath for uint256; uint public storedData; - constructor() public { + constructor() { storedData = 100; } diff --git a/libs/remix-tests/tests/examples_5/lib/EvenOdd.sol b/libs/remix-tests/tests/examples_5/lib/EvenOdd.sol index eca275a7a7..a1536375a6 100644 --- a/libs/remix-tests/tests/examples_5/lib/EvenOdd.sol +++ b/libs/remix-tests/tests/examples_5/lib/EvenOdd.sol @@ -1,4 +1,4 @@ -pragma solidity >= 0.5.0 < 0.7.0; +pragma solidity >= 0.5.0 < 0.8.0; contract EvenOdd { diff --git a/libs/remix-tests/tests/examples_5/test/simple_storage_test.sol b/libs/remix-tests/tests/examples_5/test/simple_storage_test.sol index 4f472cf28a..c5ef812a61 100644 --- a/libs/remix-tests/tests/examples_5/test/simple_storage_test.sol +++ b/libs/remix-tests/tests/examples_5/test/simple_storage_test.sol @@ -1,4 +1,4 @@ -pragma solidity >= 0.5.0 < 0.7.0; +pragma solidity >= 0.5.0 < 0.8.0; import "./../contract/simple_storage.sol"; contract StorageResolveTest { diff --git a/libs/remix-tests/tests/number/number_test.sol b/libs/remix-tests/tests/number/number_test.sol index 9e62d01b9a..3bbfbc14f0 100644 --- a/libs/remix-tests/tests/number/number_test.sol +++ b/libs/remix-tests/tests/number/number_test.sol @@ -1,4 +1,4 @@ -pragma solidity >= 0.5.0 < 0.7.0; +pragma solidity >= 0.5.0 < 0.8.0; contract IntegerTest {