contracts updated

latestSolVersion
aniket-engg 4 years ago
parent 0b59cf9df0
commit df2fa6687f
  1. 14
      apps/remix-ide-e2e/src/examples/example-contracts.ts
  2. 6
      apps/remix-ide-e2e/src/tests/debugger.test.ts
  3. 2
      apps/remix-ide-e2e/src/tests/signingMessage.test.ts
  4. 26
      apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts
  5. 2
      apps/remix-ide-e2e/src/tests/staticAnalysis.test.ts
  6. 4
      apps/remix-ide-e2e/src/tests/usingWebWorker.test.ts
  7. 2
      apps/remix-ide/src/app/tabs/testTab/testTab.js
  8. 4
      libs/remix-debug/test/debugger.js
  9. 6
      libs/remix-lib/test/txFormat.js
  10. 2
      libs/remix-tests/sol/tests.sol.ts
  11. 4
      libs/remix-tests/tests/examples_1/simple_storage.sol
  12. 2
      libs/remix-tests/tests/examples_1/simple_storage_test.sol
  13. 2
      libs/remix-tests/tests/examples_2/simple_storage.sol
  14. 2
      libs/remix-tests/tests/examples_2/simple_storage_test.sol
  15. 2
      libs/remix-tests/tests/examples_3/simple_string.sol
  16. 2
      libs/remix-tests/tests/examples_3/simple_string_test.sol
  17. 2
      libs/remix-tests/tests/examples_4/SafeMath.sol
  18. 2
      libs/remix-tests/tests/examples_4/SafeMathProxy.sol
  19. 2
      libs/remix-tests/tests/examples_4/SafeMath_test.sol
  20. 4
      libs/remix-tests/tests/examples_5/contract/simple_storage.sol
  21. 2
      libs/remix-tests/tests/examples_5/lib/EvenOdd.sol
  22. 2
      libs/remix-tests/tests/examples_5/test/simple_storage_test.sol
  23. 2
      libs/remix-tests/tests/number/number_test.sol

@ -1,6 +1,6 @@
'use strict' 'use strict'
const storage = `pragma solidity >=0.4.22 <0.7.0; const storage = `pragma solidity >=0.4.22 <0.8.0;
/** /**
* @title Storage * @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 * @title Owner
@ -54,7 +54,7 @@ contract Owner {
/** /**
* @dev Set contract deployer as 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 owner = msg.sender; // 'msg.sender' is sender of current call, contract deployer for a constructor
emit OwnerSet(address(0), owner); 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 * @title Ballot
@ -109,7 +109,7 @@ contract Ballot {
* @dev Create a new ballot to choose one of 'proposalNames'. * @dev Create a new ballot to choose one of 'proposalNames'.
* @param proposalNames names of proposals * @param proposalNames names of proposals
*/ */
constructor(bytes32[] memory proposalNames) public { constructor(bytes32[] memory proposalNames) {
chairperson = msg.sender; chairperson = msg.sender;
voters[chairperson].weight = 1; 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 { contract Ballot {
struct Voter { 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 "remix_tests.sol"; // this import is automatically injected by Remix.
import "../3_Ballot.sol"; import "../3_Ballot.sol";

@ -178,7 +178,7 @@ const sources = [
{ {
'browser/blah.sol': { 'browser/blah.sol': {
content: ` content: `
pragma solidity >=0.4.22 <0.6.0; pragma solidity >=0.4.22 <0.8.0;
contract Kickstarter { contract Kickstarter {
@ -193,7 +193,7 @@ const sources = [
Project[] public projects; Project[] public projects;
constructor() public { constructor() {
} }
@ -236,7 +236,7 @@ const sources = [
{ {
'browser/locals.sol': { 'browser/locals.sol': {
content: ` content: `
pragma solidity ^0.6.0; pragma solidity ^0.7.0;
contract test { contract test {
function t () public { function t () public {
uint[] memory array = new uint[](150); uint[] memory array = new uint[](150);

@ -55,7 +55,7 @@ module.exports = {
const sources = [ const sources = [
{ {
'browser/signMassage.sol': {content: ` 'browser/signMassage.sol': {content: `
pragma solidity >=0.4.22 <0.7.0; pragma solidity >=0.4.22 <0.8.0;
contract SignMassageTest { contract SignMassageTest {
function testRecovery(bytes32 h, uint8 v, bytes32 r, bytes32 s) public pure returns (address) { function testRecovery(bytes32 h, uint8 v, bytes32 r, bytes32 s) public pure returns (address) {
return ecrecover(h, v, r, s); return ecrecover(h, v, r, s);

@ -172,7 +172,7 @@ function runTests (browser: NightwatchBrowser) {
.pause(500) .pause(500)
.scrollAndClick('#runTestsTabRunAction') .scrollAndClick('#runTestsTabRunAction')
.waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutputheader"]', 40000) .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', 'browser/tests/4_Ballot_test.sol')
.assert.containsText('#solidityUnittestsOutput', '✓ Check winning proposal') .assert.containsText('#solidityUnittestsOutput', '✓ Check winning proposal')
.assert.containsText('#solidityUnittestsOutput', '✓ Check winnin proposal with return value') .assert.containsText('#solidityUnittestsOutput', '✓ Check winnin proposal with return value')
@ -183,12 +183,12 @@ const sources = [
{ {
'browser/simple_storage.sol': { 'browser/simple_storage.sol': {
content: ` content: `
pragma solidity >=0.4.22 <0.7.0; pragma solidity >=0.4.22 <0.8.0;
contract SimpleStorage { contract SimpleStorage {
uint public storedData; uint public storedData;
constructor() public { constructor() {
storedData = 100; storedData = 100;
} }
@ -204,7 +204,7 @@ const sources = [
}, },
'browser/tests/simple_storage_test.sol': { 'browser/tests/simple_storage_test.sol': {
content: ` content: `
pragma solidity >=0.4.22 <0.7.0; pragma solidity >=0.4.22 <0.8.0;
import "remix_tests.sol"; import "remix_tests.sol";
import "../simple_storage.sol"; import "../simple_storage.sol";
@ -233,7 +233,7 @@ const sources = [
}, },
'browser/ks2a.sol': { 'browser/ks2a.sol': {
content: ` content: `
pragma solidity >=0.4.22 <0.6.0; pragma solidity >=0.4.22 <0.8.0;
contract Kickstarter { contract Kickstarter {
enum State { Started, Completed } enum State { Started, Completed }
@ -246,14 +246,14 @@ const sources = [
State state; State state;
mapping(address => uint) funders; // added mapping(address => uint) funders; // added
} }
uint numProjects;
Project[] public projects; Project[] public projects;
constructor() public { constructor() {
} }
function createProject(string memory name, uint goal) public { function createProject(string memory name, uint goal) public {
projects.length++; // new line projects.push(); // new line
Project storage project = projects[projects.length - 1]; Project storage project = projects[projects.length - 1];
project.name = name; project.name = name;
project.goal = goal; project.goal = goal;
@ -287,7 +287,7 @@ const sources = [
}, },
'browser/tests/ks2b_test.sol': { 'browser/tests/ks2b_test.sol': {
content: ` content: `
pragma solidity >=0.4.22 <0.6.0; pragma solidity >=0.4.22 <0.8.0;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
import "remix_tests.sol"; // this import is automatically injected by Remix. import "remix_tests.sol"; // this import is automatically injected by Remix.
@ -336,7 +336,7 @@ const sources = [
} }
function checkProjectIsFundable () public { 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); (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"); Assert.equal(amountContributed, 120000, "contributed amount is incorrect");
} }
@ -357,10 +357,10 @@ const sources = [
}, },
'browser/tests/deployError_test.sol': { 'browser/tests/deployError_test.sol': {
content: ` content: `
pragma solidity ^0.6.0; pragma solidity ^0.8.0;
contract failingDeploy { contract failingDeploy {
constructor() public { constructor() {
revert('Deploy Failed'); revert('Deploy Failed');
} }
} }
@ -368,7 +368,7 @@ const sources = [
}, },
'browser/tests/methodFailure_test.sol': { 'browser/tests/methodFailure_test.sol': {
content: ` content: `
pragma solidity ^0.6.0; pragma solidity ^0.8.0;
contract methodfailure { contract methodfailure {
function add(uint a, uint b) public { function add(uint a, uint b) public {

@ -6,7 +6,7 @@ import sauce from './sauce'
const sources = [ const sources = [
{ {
'browser/Untitled.sol': {content: ` '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 test1 { address test = tx.origin; }
contract test2 {} contract test2 {}
contract TooMuchGas { contract TooMuchGas {

@ -5,14 +5,14 @@ import sauce from './sauce'
const sources = [ const sources = [
{'browser/basic.sol': { content: {'browser/basic.sol': { content:
`pragma solidity >=0.2.0 <0.7.0; `pragma solidity >=0.2.0 <0.8.0;
/** /**
* @title Basic contract * @title Basic contract
*/ */
contract Basic { contract Basic {
uint someVar; uint someVar;
constructor() public {} constructor() {}
}` }`
}} }}
] ]

@ -63,7 +63,7 @@ class TestTabLogic {
let relative = remixPath.relative(this.currentPath, remixPath.dirname(fileToImport)) let relative = remixPath.relative(this.currentPath, remixPath.dirname(fileToImport))
if (relative === '') relative = '.' if (relative === '') relative = '.'
const comment = hasCurrent ? `import "${relative}/${remixPath.basename(fileToImport)}";` : '// Import here the file to test.' 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. import "remix_tests.sol"; // this import is automatically injected by Remix.
${comment} ${comment}

@ -8,7 +8,7 @@ var vmCall = require('./vmCall')
var Debugger = require('../src/Ethdebugger') var Debugger = require('../src/Ethdebugger')
var compiler = require('solc') 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 * @title Ballot
@ -40,7 +40,7 @@ contract Ballot {
* @dev Create a new ballot to choose one of 'proposalNames'. * @dev Create a new ballot to choose one of 'proposalNames'.
* @param proposalNames names of proposals * @param proposalNames names of proposals
*/ */
constructor(bytes32[] memory proposalNames) public { constructor(bytes32[] memory proposalNames) {
uint p = 45; uint p = 45;
chairperson = msg.sender; chairperson = msg.sender;
address addressLocal = msg.sender; // copy of state variable address addressLocal = msg.sender; // copy of state variable

@ -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 { library lib1 {
function getEmpty () public { 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 { contract testContractLinkLibrary {
function get (uint _p, string memory _o) public { 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 { contract fallbackAndReceiveFunctionContract {
function get (uint _p, string memory _o) public { function get (uint _p, string memory _o) public {

@ -1,5 +1,5 @@
module.exports = ` module.exports = `
pragma solidity >=0.4.22 <0.7.0; pragma solidity >=0.4.22 <0.8.0;
library Assert { library Assert {

@ -1,8 +1,8 @@
pragma solidity >= 0.5.0 < 0.7.0; pragma solidity >= 0.5.0 < 0.8.0;
contract SimpleStorage { contract SimpleStorage {
uint public storedData; uint public storedData;
constructor() public { constructor() {
storedData = 100; storedData = 100;
} }

@ -1,4 +1,4 @@
pragma solidity >= 0.5.0 < 0.7.0; pragma solidity >= 0.5.0 < 0.8.0;
import "./simple_storage.sol"; import "./simple_storage.sol";
contract MyTest { contract MyTest {

@ -1,4 +1,4 @@
pragma solidity >= 0.5.0 < 0.7.0; pragma solidity >= 0.5.0 < 0.8.0;
contract SimpleStorage { contract SimpleStorage {
uint public storedData; uint public storedData;

@ -1,4 +1,4 @@
pragma solidity >= 0.5.0 < 0.7.0; pragma solidity >= 0.5.0 < 0.8.0;
import "./simple_storage.sol"; import "./simple_storage.sol";
contract MyTest { contract MyTest {

@ -1,4 +1,4 @@
pragma solidity >= 0.5.0 < 0.7.0; pragma solidity >= 0.5.0 < 0.8.0;
contract SimpleString { contract SimpleString {
string public storedData; string public storedData;

@ -1,4 +1,4 @@
pragma solidity >= 0.5.0 < 0.7.0; pragma solidity >= 0.5.0 < 0.8.0;
import "./simple_string.sol"; import "./simple_string.sol";
contract StringTest { contract StringTest {

@ -1,6 +1,6 @@
// Copyright (c) 2016 Smart Contract Solutions, Inc. // Copyright (c) 2016 Smart Contract Solutions, Inc.
pragma solidity >=0.4.22 <0.7.0; pragma solidity >=0.4.22 <0.8.0;
/** /**

@ -1,4 +1,4 @@
pragma solidity >=0.4.22 <0.7.0; pragma solidity >=0.4.22 <0.8.0;
import "./SafeMath.sol"; import "./SafeMath.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 "remix_tests.sol";
import "./SafeMath.sol"; import "./SafeMath.sol";
import "./SafeMathProxy.sol"; import "./SafeMathProxy.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 "../../examples_4/SafeMath.sol";
import "../lib/EvenOdd.sol"; import "../lib/EvenOdd.sol";
@ -7,7 +7,7 @@ contract SimpleStorage is EvenOdd{
using SafeMath for uint256; using SafeMath for uint256;
uint public storedData; uint public storedData;
constructor() public { constructor() {
storedData = 100; storedData = 100;
} }

@ -1,4 +1,4 @@
pragma solidity >= 0.5.0 < 0.7.0; pragma solidity >= 0.5.0 < 0.8.0;
contract EvenOdd { contract EvenOdd {

@ -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"; import "./../contract/simple_storage.sol";
contract StorageResolveTest { contract StorageResolveTest {

@ -1,4 +1,4 @@
pragma solidity >= 0.5.0 < 0.7.0; pragma solidity >= 0.5.0 < 0.8.0;
contract IntegerTest { contract IntegerTest {

Loading…
Cancel
Save