diff --git a/test_apps/contracts_app/contracts.json b/test_apps/contracts_app/contracts.json index d4112a28..2b0dfc59 100644 --- a/test_apps/contracts_app/contracts.json +++ b/test_apps/contracts_app/contracts.json @@ -2,7 +2,7 @@ "default": { "versions": { "web3": "1.0.0-beta.27", - "solc": "0.4.17" + "solc": "0.4.24" }, "deployment": { "host": "localhost", diff --git a/test_apps/contracts_app/contracts/another_storage.sol b/test_apps/contracts_app/contracts/another_storage.sol index 92233769..2bf83d1d 100644 --- a/test_apps/contracts_app/contracts/another_storage.sol +++ b/test_apps/contracts_app/contracts/another_storage.sol @@ -1,9 +1,9 @@ -pragma solidity ^0.4.17; +pragma solidity ^0.4.24; contract AnotherStorage { address public simpleStorageAddress; address simpleStorageAddress2; - function AnotherStorage(address addr) public { + constructor(address addr) public { simpleStorageAddress = addr; } diff --git a/test_apps/contracts_app/contracts/contract_args.sol b/test_apps/contracts_app/contracts/contract_args.sol index 1bf7a2d3..a1019181 100644 --- a/test_apps/contracts_app/contracts/contract_args.sol +++ b/test_apps/contracts_app/contracts/contract_args.sol @@ -1,3 +1,5 @@ +pragma solidity ^0.4.24; + contract ContractArgs { address public addr_1; address public addr_2; @@ -5,7 +7,7 @@ contract ContractArgs { function() public payable { } - function ContractArgs(address[] _addresses, uint initialValue) public { + constructor(address[] _addresses, uint initialValue) public { addr_1 = _addresses[0]; addr_2 = _addresses[1]; value = initialValue; diff --git a/test_apps/contracts_app/contracts/ownable.sol b/test_apps/contracts_app/contracts/ownable.sol index af8aa0cf..3725007c 100644 --- a/test_apps/contracts_app/contracts/ownable.sol +++ b/test_apps/contracts_app/contracts/ownable.sol @@ -13,7 +13,7 @@ contract Ownable { * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ - function Ownable() public { + constructor() public { owner = msg.sender; } diff --git a/test_apps/contracts_app/contracts/simple_storage.sol b/test_apps/contracts_app/contracts/simple_storage.sol index c72e8e98..333c03ff 100644 --- a/test_apps/contracts_app/contracts/simple_storage.sol +++ b/test_apps/contracts_app/contracts/simple_storage.sol @@ -6,7 +6,7 @@ library Assert { event TestEvent(bool passed, string message); function triggerEvent(bool passed, string message) internal { - TestEvent(passed, message); + emit TestEvent(passed, message); } } @@ -15,7 +15,7 @@ contract SimpleStorage is Ownable { function() public payable { } - function SimpleStorage(uint initialValue) public { + constructor(uint initialValue) public { storedData = initialValue; } @@ -27,7 +27,7 @@ contract SimpleStorage is Ownable { Assert.triggerEvent(true, "hi"); } - function set2(uint x, uint unusedGiveWarning) public onlyOwner { + function set2(uint x) public onlyOwner { storedData = x; } diff --git a/test_apps/contracts_app/contracts/some_contract.sol b/test_apps/contracts_app/contracts/some_contract.sol index fa69a88b..9297cfae 100644 --- a/test_apps/contracts_app/contracts/some_contract.sol +++ b/test_apps/contracts_app/contracts/some_contract.sol @@ -1,3 +1,5 @@ +pragma solidity ^0.4.24; + contract SomeContract { address public addr_1; address public addr_2; @@ -5,7 +7,7 @@ contract SomeContract { function() public payable { } - function SomeContract(address[] _addresses, uint initialValue) public { + constructor(address[] _addresses, uint initialValue) public { addr_1 = _addresses[0]; addr_2 = _addresses[1]; value = initialValue; diff --git a/test_apps/contracts_app/contracts/token.sol b/test_apps/contracts_app/contracts/token.sol index 32b1dafd..39584bca 100644 --- a/test_apps/contracts_app/contracts/token.sol +++ b/test_apps/contracts_app/contracts/token.sol @@ -10,7 +10,7 @@ contract Token { mapping( address => mapping( address => uint ) ) _approvals; uint public _supply; //uint public _supply2; - function Token( uint initial_balance ) public { + constructor( uint initial_balance ) public { _balances[msg.sender] = initial_balance; _supply = initial_balance; } @@ -29,7 +29,7 @@ contract Token { } _balances[msg.sender] -= value; _balances[to] += value; - Transfer( msg.sender, to, value ); + emit Transfer( msg.sender, to, value ); return true; } function transferFrom( address from, address to, uint value) public returns (bool ok) { @@ -48,13 +48,13 @@ contract Token { _approvals[from][msg.sender] -= value; _balances[from] -= value; _balances[to] += value; - Transfer( from, to, value ); + emit Transfer( from, to, value ); return true; } function approve(address spender, uint value) public returns (bool ok) { // TODO: should increase instead _approvals[msg.sender][spender] = value; - Approval( msg.sender, spender, value ); + emit Approval( msg.sender, spender, value ); return true; } function allowance(address owner, address spender) public constant returns (uint _allowance) {