Update tests.

This commit is contained in:
chriseth 2020-06-23 14:14:24 +02:00
parent 747aeb4999
commit 9743390a53
325 changed files with 757 additions and 776 deletions

View File

@ -2,7 +2,7 @@
pragma solidity >=0.6.0; pragma solidity >=0.6.0;
contract C { contract C {
constructor() public {} constructor() {}
} }
contract D is C { contract D is C {
} }

View File

@ -5,10 +5,10 @@ Warning: Source file does not specify required compiler version!
--> message_format_utf8/input.sol --> message_format_utf8/input.sol
Warning: Statement has no effect. Warning: Statement has no effect.
--> message_format_utf8/input.sol:2:58: --> message_format_utf8/input.sol:2:51:
| |
2 | /* ©©©©ᄅ©©©©© 2017 */ constructor () public { "©©©©ᄅ©©©©©" ; } 2 | /* ©©©©ᄅ©©©©© 2017 */ constructor () { "©©©©ᄅ©©©©©" ; }
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
Warning: Statement has no effect. Warning: Statement has no effect.
--> message_format_utf8/input.sol:6:25: --> message_format_utf8/input.sol:6:25:

View File

@ -1,5 +1,5 @@
contract Foo { contract Foo {
/* ©©©©ᄅ©©©©© 2017 */ constructor () public { "©©©©ᄅ©©©©©" ; } /* ©©©©ᄅ©©©©© 2017 */ constructor () { "©©©©ᄅ©©©©©" ; }
function f() public pure { function f() public pure {

View File

@ -3,7 +3,7 @@ pragma solidity >=0.0;
contract C contract C
{ {
constructor() public payable constructor() payable
{ {
int a; int a;

View File

@ -1,69 +1,69 @@
======= optimizer_user_yul/input.sol:C ======= ======= optimizer_user_yul/input.sol:C =======
EVM assembly: EVM assembly:
/* "optimizer_user_yul/input.sol":60:525 contract C... */ /* "optimizer_user_yul/input.sol":60:518 contract C... */
mstore(0x40, 0x80) mstore(0x40, 0x80)
/* "optimizer_user_yul/input.sol":108:113 int a */ /* "optimizer_user_yul/input.sol":101:106 int a */
0x00 0x00
/* "optimizer_user_yul/input.sol":188:197 let x,y,z */ /* "optimizer_user_yul/input.sol":181:190 let x,y,z */
dup1 dup1
0x00 0x00
dup1 dup1
/* "optimizer_user_yul/input.sol":212:213 1 */ /* "optimizer_user_yul/input.sol":205:206 1 */
0x01 0x01
/* "optimizer_user_yul/input.sol":209:210 0 */ /* "optimizer_user_yul/input.sol":202:203 0 */
0x00 0x00
/* "optimizer_user_yul/input.sol":202:214 sstore(0, 1) */ /* "optimizer_user_yul/input.sol":195:207 sstore(0, 1) */
sstore sstore
/* "optimizer_user_yul/input.sol":219:265 for { } sload(4) { } {... */ /* "optimizer_user_yul/input.sol":212:258 for { } sload(4) { } {... */
tag_3: tag_3:
/* "optimizer_user_yul/input.sol":233:234 4 */ /* "optimizer_user_yul/input.sol":226:227 4 */
0x04 0x04
/* "optimizer_user_yul/input.sol":227:235 sload(4) */ /* "optimizer_user_yul/input.sol":220:228 sload(4) */
sload sload
/* "optimizer_user_yul/input.sol":219:265 for { } sload(4) { } {... */ /* "optimizer_user_yul/input.sol":212:258 for { } sload(4) { } {... */
iszero iszero
tag_5 tag_5
jumpi jumpi
pop pop
/* "optimizer_user_yul/input.sol":251:260 exp(x, y) */ /* "optimizer_user_yul/input.sol":244:253 exp(x, y) */
dup1 dup1
dup3 dup3
exp exp
/* "optimizer_user_yul/input.sol":219:265 for { } sload(4) { } {... */ /* "optimizer_user_yul/input.sol":212:258 for { } sload(4) { } {... */
jump(tag_3) jump(tag_3)
tag_5: tag_5:
/* "optimizer_user_yul/input.sol":223:226 { } */ /* "optimizer_user_yul/input.sol":216:219 { } */
pop pop
pop pop
pop pop
/* "optimizer_user_yul/input.sol":275:276 2 */ /* "optimizer_user_yul/input.sol":268:269 2 */
0x02 0x02
/* "optimizer_user_yul/input.sol":270:276 a := 2 */ /* "optimizer_user_yul/input.sol":263:269 a := 2 */
swap1 swap1
pop pop
/* "optimizer_user_yul/input.sol":376:377 3 */ /* "optimizer_user_yul/input.sol":369:370 3 */
0x03 0x03
/* "optimizer_user_yul/input.sol":373:374 2 */ /* "optimizer_user_yul/input.sol":366:367 2 */
0x02 0x02
/* "optimizer_user_yul/input.sol":366:378 sstore(2, 3) */ /* "optimizer_user_yul/input.sol":359:371 sstore(2, 3) */
sstore sstore
/* "optimizer_user_yul/input.sol":383:516 for { } sload(5) { } {... */ /* "optimizer_user_yul/input.sol":376:509 for { } sload(5) { } {... */
tag_6: tag_6:
/* "optimizer_user_yul/input.sol":397:398 5 */ /* "optimizer_user_yul/input.sol":390:391 5 */
0x05 0x05
/* "optimizer_user_yul/input.sol":391:399 sload(5) */ /* "optimizer_user_yul/input.sol":384:392 sload(5) */
sload sload
tag_9 tag_9
jumpi jumpi
jump(tag_8) jump(tag_8)
tag_9: tag_9:
/* "optimizer_user_yul/input.sol":383:516 for { } sload(5) { } {... */ /* "optimizer_user_yul/input.sol":376:509 for { } sload(5) { } {... */
jump(tag_6) jump(tag_6)
tag_8: tag_8:
/* "optimizer_user_yul/input.sol":347:520 {... */ /* "optimizer_user_yul/input.sol":340:513 {... */
pop pop
/* "optimizer_user_yul/input.sol":60:525 contract C... */ /* "optimizer_user_yul/input.sol":60:518 contract C... */
dataSize(sub_0) dataSize(sub_0)
dup1 dup1
dataOffset(sub_0) dataOffset(sub_0)
@ -74,7 +74,7 @@ tag_8:
stop stop
sub_0: assembly { sub_0: assembly {
/* "optimizer_user_yul/input.sol":60:525 contract C... */ /* "optimizer_user_yul/input.sol":60:518 contract C... */
mstore(0x40, 0x80) mstore(0x40, 0x80)
0x00 0x00
dup1 dup1

View File

@ -2,7 +2,7 @@
pragma solidity >=0.0.0; pragma solidity >=0.0.0;
contract Error1 { contract Error1 {
constructor() public { constructor() {
balances[tx.origin] = ; // missing RHS. balances[tx.origin] = ; // missing RHS.
} }

View File

@ -97,7 +97,7 @@ JSON AST:
"children": [], "children": [],
"id": 3, "id": 3,
"name": "ParameterList", "name": "ParameterList",
"src": "103:0:0" "src": "96:0:0"
}, },
{ {
"attributes": "attributes":
@ -110,12 +110,12 @@ JSON AST:
"children": [], "children": [],
"id": 8, "id": 8,
"name": "Block", "name": "Block",
"src": "103:49:0" "src": "96:49:0"
} }
], ],
"id": 9, "id": 9,
"name": "FunctionDefinition", "name": "FunctionDefinition",
"src": "82:70:0" "src": "82:63:0"
}, },
{ {
"attributes": "attributes":
@ -147,7 +147,7 @@ JSON AST:
"children": [], "children": [],
"id": 10, "id": 10,
"name": "ParameterList", "name": "ParameterList",
"src": "418:2:0" "src": "411:2:0"
}, },
{ {
"children": "children":
@ -174,17 +174,17 @@ JSON AST:
}, },
"id": 11, "id": 11,
"name": "ElementaryTypeName", "name": "ElementaryTypeName",
"src": "441:4:0" "src": "434:4:0"
} }
], ],
"id": 12, "id": 12,
"name": "VariableDeclaration", "name": "VariableDeclaration",
"src": "441:4:0" "src": "434:4:0"
} }
], ],
"id": 13, "id": 13,
"name": "ParameterList", "name": "ParameterList",
"src": "440:6:0" "src": "433:6:0"
}, },
{ {
"children": "children":
@ -210,30 +210,30 @@ JSON AST:
}, },
"id": 14, "id": 14,
"name": "Literal", "name": "Literal",
"src": "460:1:0" "src": "453:1:0"
} }
], ],
"id": 15, "id": 15,
"name": "Return", "name": "Return",
"src": "453:8:0" "src": "446:8:0"
} }
], ],
"id": 16, "id": 16,
"name": "Block", "name": "Block",
"src": "447:19:0" "src": "440:19:0"
} }
], ],
"id": 17, "id": 17,
"name": "FunctionDefinition", "name": "FunctionDefinition",
"src": "405:61:0" "src": "398:61:0"
} }
], ],
"id": 18, "id": 18,
"name": "ContractDefinition", "name": "ContractDefinition",
"src": "62:406:0" "src": "62:399:0"
} }
], ],
"id": 19, "id": 19,
"name": "SourceUnit", "name": "SourceUnit",
"src": "36:433:0" "src": "36:426:0"
} }

View File

@ -4,7 +4,7 @@
{ {
"A": "A":
{ {
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0; contract A { constructor(uint) public {} } contract B is A(2) { } contract C is A(3) {} contract D is B, C {}" "content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0; contract A { constructor(uint) {} } contract B is A(2) { } contract C is A(3) {} contract D is B, C {}"
} }
} }
} }

View File

@ -1,10 +1,10 @@
{"errors":[{"component":"general","errorCode":"3364","formattedMessage":"A:2:112: DeclarationError: Base constructor arguments given twice. {"errors":[{"component":"general","errorCode":"3364","formattedMessage":"A:2:105: DeclarationError: Base constructor arguments given twice.
pragma solidity >=0.0; contract A { constructor(uint) public {} } contract B is A(2) { } contract C is A(3) {} contract D is B, C {} pragma solidity >=0.0; contract A { constructor(uint) {} } contract B is A(2) { } contract C is A(3) {} contract D is B, C {}
^-------------------^ ^-------------------^
A:2:81: First constructor call is here: A:2:74: First constructor call is here:
pragma solidity >=0.0; contract A { constructor(uint) public {} } contract B is A(2) { } contract C is A(3) {} contract D is B, C {} pragma solidity >=0.0; contract A { constructor(uint) {} } contract B is A(2) { } contract C is A(3) {} contract D is B, C {}
^--^ ^--^
A:2:104: Second constructor call is here: A:2:97: Second constructor call is here:
pragma solidity >=0.0; contract A { constructor(uint) public {} } contract B is A(2) { } contract C is A(3) {} contract D is B, C {} pragma solidity >=0.0; contract A { constructor(uint) {} } contract B is A(2) { } contract C is A(3) {} contract D is B, C {}
^--^ ^--^
","message":"Base constructor arguments given twice.","secondarySourceLocations":[{"end":119,"file":"A","message":"First constructor call is here:","start":115},{"end":142,"file":"A","message":"Second constructor call is here:","start":138}],"severity":"error","sourceLocation":{"end":167,"file":"A","start":146},"type":"DeclarationError"}],"sources":{}} ","message":"Base constructor arguments given twice.","secondarySourceLocations":[{"end":112,"file":"A","message":"First constructor call is here:","start":108},{"end":135,"file":"A","message":"Second constructor call is here:","start":131}],"severity":"error","sourceLocation":{"end":160,"file":"A","start":139},"type":"DeclarationError"}],"sources":{}}

View File

@ -3,5 +3,5 @@ pragma solidity >=0.0;
contract C contract C
{ {
constructor() public {} constructor() {}
} }

View File

@ -104,7 +104,6 @@ contract MultiSigWallet {
/// @param _owners List of initial owners. /// @param _owners List of initial owners.
/// @param _required Number of required confirmations. /// @param _required Number of required confirmations.
constructor(address[] memory _owners, uint _required) constructor(address[] memory _owners, uint _required)
public
validRequirement(_owners.length, _required) validRequirement(_owners.length, _required)
{ {
for (uint i=0; i<_owners.length; i++) { for (uint i=0; i<_owners.length; i++) {

View File

@ -20,7 +20,6 @@ contract MultiSigWalletWithDailyLimit is MultiSigWallet {
/// @param _required Number of required confirmations. /// @param _required Number of required confirmations.
/// @param _dailyLimit Amount in wei, which can be withdrawn without confirmations on a daily basis. /// @param _dailyLimit Amount in wei, which can be withdrawn without confirmations on a daily basis.
constructor(address[] memory _owners, uint _required, uint _dailyLimit) constructor(address[] memory _owners, uint _required, uint _dailyLimit)
public
MultiSigWallet(_owners, _required) MultiSigWallet(_owners, _required)
{ {
dailyLimit = _dailyLimit; dailyLimit = _dailyLimit;

View File

@ -50,7 +50,7 @@ contract ico is safeMath {
uint256 public totalMint; uint256 public totalMint;
uint256 public totalPremiumMint; uint256 public totalPremiumMint;
constructor(address payable foundation, address priceSet, uint256 exchangeRate, uint256 startBlockNum, address[] memory genesisAddr, uint256[] memory genesisValue) public { constructor(address payable foundation, address priceSet, uint256 exchangeRate, uint256 startBlockNum, address[] memory genesisAddr, uint256[] memory genesisValue) {
/* /*
Installation function. Installation function.

View File

@ -36,7 +36,7 @@ contract moduleHandler is multiOwner, announcementTypes {
uint256 debugModeUntil = block.number + 1000000; uint256 debugModeUntil = block.number + 1000000;
constructor(address[] memory newOwners) multiOwner(newOwners) public {} constructor(address[] memory newOwners) multiOwner(newOwners) {}
function load(address payable foundation, bool forReplace, address payable Token, address payable Premium, address payable Publisher, address payable Schelling, address payable Provider) public { function load(address payable foundation, bool forReplace, address payable Token, address payable Premium, address payable Publisher, address payable Schelling, address payable Provider) public {
/* /*
Loading modulest to ModuleHandler. Loading modulest to ModuleHandler.

View File

@ -12,7 +12,7 @@ contract multiOwner is safeMath {
/* /*
Constructor Constructor
*/ */
constructor(address[] memory newOwners) public { constructor(address[] memory newOwners) {
for ( uint256 a=0 ; a<newOwners.length ; a++ ) { for ( uint256 a=0 ; a<newOwners.length ; a++ ) {
_addOwner(newOwners[a]); _addOwner(newOwners[a]);
} }

View File

@ -40,7 +40,7 @@ contract premium is module, safeMath {
mapping(address => bool) public genesis; mapping(address => bool) public genesis;
constructor(bool forReplace, address payable moduleHandler, address dbAddress, address icoContractAddr, address[] memory genesisAddr, uint256[] memory genesisValue) public { constructor(bool forReplace, address payable moduleHandler, address dbAddress, address icoContractAddr, address[] memory genesisAddr, uint256[] memory genesisValue) {
/* /*
Setup function. Setup function.
If an ICOaddress is defined then the balance of the genesis addresses will be set as well. If an ICOaddress is defined then the balance of the genesis addresses will be set as well.

View File

@ -118,7 +118,7 @@ contract provider is module, safeMath, announcementTypes {
uint256 private currentSchellingRound = 1; uint256 private currentSchellingRound = 1;
constructor(address payable _moduleHandler) public { constructor(address payable _moduleHandler) {
/* /*
Install function. Install function.

View File

@ -61,7 +61,7 @@ contract publisher is announcementTypes, module, safeMath {
mapping (address => uint256[]) public opponents; mapping (address => uint256[]) public opponents;
constructor(address payable moduleHandler) public { constructor(address payable moduleHandler) {
/* /*
Installation function. The installer will be registered in the admin list automatically Installation function. The installer will be registered in the admin list automatically

View File

@ -45,7 +45,7 @@ contract schellingDB is safeMath, schellingVars {
/* /*
Constructor Constructor
*/ */
constructor() public { constructor() {
rounds.push(); rounds.push();
rounds.push(); rounds.push();
rounds[0].blockHeight = block.number; rounds[0].blockHeight = block.number;
@ -249,7 +249,7 @@ contract schelling is module, announcementTypes, schellingVars {
bytes1 public belowChar = 0x30; bytes1 public belowChar = 0x30;
schellingDB private db; schellingDB private db;
constructor(address payable _moduleHandler, address _db, bool _forReplace) public { constructor(address payable _moduleHandler, address _db, bool _forReplace) {
/* /*
Installation function. Installation function.

View File

@ -49,7 +49,7 @@ contract token is safeMath, module, announcementTypes {
mapping(address => bool) public genesis; mapping(address => bool) public genesis;
constructor(bool forReplace, address payable moduleHandler, address dbAddr, address payable icoContractAddr, address payable exchangeContractAddress, address payable[] memory genesisAddr, uint256[] memory genesisValue) public payable { constructor(bool forReplace, address payable moduleHandler, address dbAddr, address payable icoContractAddr, address payable exchangeContractAddress, address payable[] memory genesisAddr, uint256[] memory genesisValue) payable {
/* /*
Installation function Installation function

View File

@ -18,7 +18,6 @@ contract CategoricalEvent is Event {
Oracle _oracle, Oracle _oracle,
uint8 outcomeCount uint8 outcomeCount
) )
public
Event(_collateralToken, _oracle, outcomeCount) Event(_collateralToken, _oracle, outcomeCount)
{ {

View File

@ -34,7 +34,6 @@ abstract contract Event {
/// @param _oracle Oracle contract used to resolve the event /// @param _oracle Oracle contract used to resolve the event
/// @param outcomeCount Number of event outcomes /// @param outcomeCount Number of event outcomes
constructor(Token _collateralToken, Oracle _oracle, uint8 outcomeCount) constructor(Token _collateralToken, Oracle _oracle, uint8 outcomeCount)
public
{ {
// Validate input // Validate input
require(address(_collateralToken) != address(0) && address(_oracle) != address(0) && outcomeCount >= 2); require(address(_collateralToken) != address(0) && address(_oracle) != address(0) && outcomeCount >= 2);

View File

@ -34,7 +34,6 @@ contract ScalarEvent is Event {
int _lowerBound, int _lowerBound,
int _upperBound int _upperBound
) )
public
Event(_collateralToken, _oracle, 2) Event(_collateralToken, _oracle, 2)
{ {
// Validate bounds // Validate bounds

View File

@ -78,7 +78,6 @@ contract Campaign {
uint _funding, uint _funding,
uint _deadline uint _deadline
) )
public
{ {
// Validate input // Validate input
require( address(_eventContract) != address(0) require( address(_eventContract) != address(0)

View File

@ -39,7 +39,6 @@ contract StandardMarket is Market {
/// @param _marketMaker Market maker contract /// @param _marketMaker Market maker contract
/// @param _fee Market fee /// @param _fee Market fee
constructor(address _creator, Event _eventContract, MarketMaker _marketMaker, uint24 _fee) constructor(address _creator, Event _eventContract, MarketMaker _marketMaker, uint24 _fee)
public
{ {
// Validate inputs // Validate inputs
require(address(_eventContract) != address(0) && address(_marketMaker) != address(0) && _fee < FEE_RANGE); require(address(_eventContract) != address(0) && address(_marketMaker) != address(0) && _fee < FEE_RANGE);

View File

@ -8,7 +8,7 @@ contract Migrations {
if (msg.sender == owner) _; if (msg.sender == owner) _;
} }
constructor() public { constructor() {
owner = msg.sender; owner = msg.sender;
} }

View File

@ -35,7 +35,6 @@ contract CentralizedOracle is Oracle {
/// @dev Constructor sets owner address and IPFS hash /// @dev Constructor sets owner address and IPFS hash
/// @param _ipfsHash Hash identifying off chain event description /// @param _ipfsHash Hash identifying off chain event description
constructor(address _owner, bytes memory _ipfsHash) constructor(address _owner, bytes memory _ipfsHash)
public
{ {
// Description hash cannot be null // Description hash cannot be null
require(_ipfsHash.length == 46); require(_ipfsHash.length == 46);

View File

@ -23,7 +23,6 @@ contract DifficultyOracle is Oracle {
/// @dev Contract constructor validates and sets target block number /// @dev Contract constructor validates and sets target block number
/// @param _blockNumber Target block number /// @param _blockNumber Target block number
constructor(uint _blockNumber) constructor(uint _blockNumber)
public
{ {
// Block has to be in the future // Block has to be in the future
require(_blockNumber > block.number); require(_blockNumber > block.number);

View File

@ -68,7 +68,6 @@ contract FutarchyOracle is Oracle {
uint24 fee, uint24 fee,
uint _deadline uint _deadline
) )
public
{ {
// Deadline is in the future // Deadline is in the future
require(_deadline > block.timestamp); require(_deadline > block.timestamp);

View File

@ -34,7 +34,6 @@ contract FutarchyOracleFactory {
/// @dev Constructor sets event factory contract /// @dev Constructor sets event factory contract
/// @param _eventFactory Event factory contract /// @param _eventFactory Event factory contract
constructor(EventFactory _eventFactory) constructor(EventFactory _eventFactory)
public
{ {
require(address(_eventFactory) != address(0)); require(address(_eventFactory) != address(0));
eventFactory = _eventFactory; eventFactory = _eventFactory;

View File

@ -17,7 +17,6 @@ contract MajorityOracle is Oracle {
/// @dev Allows to create an oracle for a majority vote based on other oracles /// @dev Allows to create an oracle for a majority vote based on other oracles
/// @param _oracles List of oracles taking part in the majority vote /// @param _oracles List of oracles taking part in the majority vote
constructor(Oracle[] memory _oracles) constructor(Oracle[] memory _oracles)
public
{ {
// At least 2 oracles should be defined // At least 2 oracles should be defined
require(_oracles.length > 2); require(_oracles.length > 2);

View File

@ -39,7 +39,6 @@ contract SignedMessageOracle is Oracle {
/// @param r Signature parameter /// @param r Signature parameter
/// @param s Signature parameter /// @param s Signature parameter
constructor(bytes32 _descriptionHash, uint8 v, bytes32 r, bytes32 s) constructor(bytes32 _descriptionHash, uint8 v, bytes32 r, bytes32 s)
public
{ {
signer = ecrecover(_descriptionHash, v, r, s); signer = ecrecover(_descriptionHash, v, r, s);
descriptionHash = _descriptionHash; descriptionHash = _descriptionHash;

View File

@ -54,7 +54,6 @@ contract UltimateOracle is Oracle {
uint _challengeAmount, uint _challengeAmount,
uint _frontRunnerPeriod uint _frontRunnerPeriod
) )
public
{ {
// Validate inputs // Validate inputs
require( address(_forwardedOracle) != address(0) require( address(_forwardedOracle) != address(0)

View File

@ -32,7 +32,6 @@ contract OutcomeToken is StandardToken {
*/ */
/// @dev Constructor sets events contract address /// @dev Constructor sets events contract address
constructor() constructor()
public
{ {
eventContract = msg.sender; eventContract = msg.sender;
} }

View File

@ -112,7 +112,7 @@ contract MilestoneTracker {
address _arbitrator, address _arbitrator,
address _donor, address _donor,
address _recipient address _recipient
) public { ) {
arbitrator = _arbitrator; arbitrator = _arbitrator;
donor = _donor; donor = _donor;
recipient = _recipient; recipient = _recipient;

View File

@ -114,7 +114,7 @@ contract GlobalRegistrar is Registrar, AuctionSystem {
uint constant c_renewalInterval = 365 days; uint constant c_renewalInterval = 365 days;
uint constant c_freeBytes = 12; uint constant c_freeBytes = 12;
constructor() public { constructor() {
// TODO: Populate with hall-of-fame. // TODO: Populate with hall-of-fame.
} }

View File

@ -100,7 +100,7 @@ contract multiowned {
// constructor is given number of sigs required to do protected "onlymanyowners" transactions // constructor is given number of sigs required to do protected "onlymanyowners" transactions
// as well as the selection of addresses capable of confirming them. // as well as the selection of addresses capable of confirming them.
constructor(address[] memory _owners, uint _required) public { constructor(address[] memory _owners, uint _required) {
m_numOwners = _owners.length + 1; m_numOwners = _owners.length + 1;
m_owners[1] = uint(msg.sender); m_owners[1] = uint(msg.sender);
m_ownerIndex[uint(msg.sender)] = 1; m_ownerIndex[uint(msg.sender)] = 1;
@ -288,7 +288,7 @@ abstract contract daylimit is multiowned {
// METHODS // METHODS
// constructor - stores initial daily limit and records the present day's index. // constructor - stores initial daily limit and records the present day's index.
constructor(uint _limit) public { constructor(uint _limit) {
m_dailyLimit = _limit; m_dailyLimit = _limit;
m_lastDay = today(); m_lastDay = today();
} }
@ -369,7 +369,7 @@ contract Wallet is multisig, multiowned, daylimit {
// constructor - just pass on the owner array to the multiowned and // constructor - just pass on the owner array to the multiowned and
// the limit to daylimit // the limit to daylimit
constructor(address[] memory _owners, uint _required, uint _daylimit) public payable constructor(address[] memory _owners, uint _required, uint _daylimit) payable
multiowned(_owners, _required) daylimit(_daylimit) { multiowned(_owners, _required) daylimit(_daylimit) {
} }

View File

@ -42,7 +42,7 @@ abstract contract ManagedAccountInterface {
contract ManagedAccount is ManagedAccountInterface{ contract ManagedAccount is ManagedAccountInterface{
// The constructor sets the owner of the account // The constructor sets the owner of the account
constructor(address _owner, bool _payOwnerOnly) public { constructor(address _owner, bool _payOwnerOnly) {
owner = _owner; owner = _owner;
payOwnerOnly = _payOwnerOnly; payOwnerOnly = _payOwnerOnly;
} }

View File

@ -318,7 +318,7 @@ BOOST_AUTO_TEST_CASE(decode_from_memory_simple)
contract C { contract C {
uint public _a; uint public _a;
uint[] public _b; uint[] public _b;
constructor(uint a, uint[] memory b) public { constructor(uint a, uint[] memory b) {
_a = a; _a = a;
_b = b; _b = b;
} }
@ -343,7 +343,7 @@ BOOST_AUTO_TEST_CASE(decode_function_type)
string sourceCode = R"( string sourceCode = R"(
contract D { contract D {
function () external returns (uint) public _a; function () external returns (uint) public _a;
constructor(function () external returns (uint) a) public { constructor(function () external returns (uint) a) {
_a = a; _a = a;
} }
} }
@ -377,13 +377,13 @@ BOOST_AUTO_TEST_CASE(decode_function_type_array)
string sourceCode = R"( string sourceCode = R"(
contract D { contract D {
function () external returns (uint)[] public _a; function () external returns (uint)[] public _a;
constructor(function () external returns (uint)[] memory a) public { constructor(function () external returns (uint)[] memory a) {
_a = a; _a = a;
} }
} }
contract E { contract E {
function () external returns (uint)[3] public _a; function () external returns (uint)[3] public _a;
constructor(function () external returns (uint)[3] memory a) public { constructor(function () external returns (uint)[3] memory a) {
_a = a; _a = a;
} }
} }
@ -445,7 +445,7 @@ BOOST_AUTO_TEST_CASE(decode_from_memory_complex)
uint public _a; uint public _a;
uint[] public _b; uint[] public _b;
bytes[2] public _c; bytes[2] public _c;
constructor(uint a, uint[] memory b, bytes[2] memory c) public { constructor(uint a, uint[] memory b, bytes[2] memory c) {
_a = a; _a = a;
_b = b; _b = b;
_c = c; _c = c;

View File

@ -718,7 +718,7 @@ BOOST_AUTO_TEST_CASE(struct_in_constructor)
string c; string c;
} }
S public x; S public x;
constructor(S memory s) public { x = s; } constructor(S memory s) { x = s; }
} }
)"; )";
@ -738,7 +738,7 @@ BOOST_AUTO_TEST_CASE(struct_in_constructor_indirect)
string c; string c;
} }
S public x; S public x;
constructor(S memory s) public { x = s; } constructor(S memory s) { x = s; }
} }
contract D { contract D {
@ -771,7 +771,7 @@ BOOST_AUTO_TEST_CASE(struct_in_constructor_data_short)
string c; string c;
} }
S public x; S public x;
constructor(S memory s) public { x = s; } constructor(S memory s) { x = s; }
} }
)"; )";

View File

@ -1,5 +1,5 @@
contract test { contract test {
constructor(uint param1, test param2, bool param3) public {} constructor(uint param1, test param2, bool param3) {}
} }
// ---- // ----
// :test // :test

View File

@ -1,7 +1,7 @@
// bug #8712 // bug #8712
contract B { abstract contract B {
uint immutable x; uint immutable x;
constructor(function() internal returns(uint) fp) internal { constructor(function() internal returns(uint) fp) {
x = fp(); } x = fp(); }
} }
// ---- // ----

View File

@ -1,5 +1,5 @@
contract test { contract test {
constructor(uint param1, test param2, bool param3) public payable {} constructor(uint param1, test param2, bool param3) payable {}
} }
// ---- // ----
// :test // :test

View File

@ -1,7 +1,7 @@
// bug #1801 // bug #1801
contract test { contract test {
enum ActionChoices { GoLeft, GoRight, GoStraight, Sit } enum ActionChoices { GoLeft, GoRight, GoStraight, Sit }
constructor(ActionChoices param) public {} constructor(ActionChoices param) {}
function ret() public returns (ActionChoices) { function ret() public returns (ActionChoices) {
ActionChoices action = ActionChoices.GoLeft; ActionChoices action = ActionChoices.GoLeft;
return action; return action;

View File

@ -31,7 +31,7 @@
{ {
"id": 3, "id": 3,
"nodeType": "Block", "nodeType": "Block",
"src": "44:4:1", "src": "37:4:1",
"statements": [] "statements": []
}, },
"id": 4, "id": 4,
@ -52,18 +52,18 @@
"id": 2, "id": 2,
"nodeType": "ParameterList", "nodeType": "ParameterList",
"parameters": [], "parameters": [],
"src": "44:0:1" "src": "37:0:1"
}, },
"scope": 5, "scope": 5,
"src": "23:25:1", "src": "23:18:1",
"stateMutability": "nonpayable", "stateMutability": "nonpayable",
"virtual": false, "virtual": false,
"visibility": "public" "visibility": "internal"
} }
], ],
"scope": 6, "scope": 6,
"src": "0:50:1" "src": "0:43:1"
} }
], ],
"src": "0:51:1" "src": "0:44:1"
} }

View File

@ -1,5 +1,5 @@
abstract contract C { abstract contract C {
constructor() public { constructor() {
} }
} }

View File

@ -49,7 +49,7 @@
"scope": 5, "scope": 5,
"stateMutability": "nonpayable", "stateMutability": "nonpayable",
"virtual": false, "virtual": false,
"visibility": "public" "visibility": "internal"
}, },
"children": "children":
[ [
@ -77,7 +77,7 @@
"children": [], "children": [],
"id": 2, "id": 2,
"name": "ParameterList", "name": "ParameterList",
"src": "44:0:1" "src": "37:0:1"
}, },
{ {
"attributes": "attributes":
@ -90,20 +90,20 @@
"children": [], "children": [],
"id": 3, "id": 3,
"name": "Block", "name": "Block",
"src": "44:4:1" "src": "37:4:1"
} }
], ],
"id": 4, "id": 4,
"name": "FunctionDefinition", "name": "FunctionDefinition",
"src": "23:25:1" "src": "23:18:1"
} }
], ],
"id": 5, "id": 5,
"name": "ContractDefinition", "name": "ContractDefinition",
"src": "0:50:1" "src": "0:43:1"
} }
], ],
"id": 6, "id": 6,
"name": "SourceUnit", "name": "SourceUnit",
"src": "0:51:1" "src": "0:44:1"
} }

View File

@ -31,7 +31,7 @@
{ {
"id": 3, "id": 3,
"nodeType": "Block", "nodeType": "Block",
"src": "35:4:1", "src": "28:4:1",
"statements": [] "statements": []
}, },
"id": 4, "id": 4,
@ -52,18 +52,18 @@
"id": 2, "id": 2,
"nodeType": "ParameterList", "nodeType": "ParameterList",
"parameters": [], "parameters": [],
"src": "35:0:1" "src": "28:0:1"
}, },
"scope": 5, "scope": 5,
"src": "14:25:1", "src": "14:18:1",
"stateMutability": "nonpayable", "stateMutability": "nonpayable",
"virtual": false, "virtual": false,
"visibility": "public" "visibility": "public"
} }
], ],
"scope": 6, "scope": 6,
"src": "0:41:1" "src": "0:34:1"
} }
], ],
"src": "0:42:1" "src": "0:35:1"
} }

View File

@ -1,5 +1,5 @@
contract C { contract C {
constructor() public { constructor() {
} }
} }

View File

@ -77,7 +77,7 @@
"children": [], "children": [],
"id": 2, "id": 2,
"name": "ParameterList", "name": "ParameterList",
"src": "35:0:1" "src": "28:0:1"
}, },
{ {
"attributes": "attributes":
@ -90,20 +90,20 @@
"children": [], "children": [],
"id": 3, "id": 3,
"name": "Block", "name": "Block",
"src": "35:4:1" "src": "28:4:1"
} }
], ],
"id": 4, "id": 4,
"name": "FunctionDefinition", "name": "FunctionDefinition",
"src": "14:25:1" "src": "14:18:1"
} }
], ],
"id": 5, "id": 5,
"name": "ContractDefinition", "name": "ContractDefinition",
"src": "0:41:1" "src": "0:34:1"
} }
], ],
"id": 6, "id": 6,
"name": "SourceUnit", "name": "SourceUnit",
"src": "0:42:1" "src": "0:35:1"
} }

View File

@ -173,7 +173,7 @@ BOOST_AUTO_TEST_CASE(store_keccak256)
char const* sourceCode = R"( char const* sourceCode = R"(
contract test { contract test {
bytes32 public shaValue; bytes32 public shaValue;
constructor() public { constructor() {
shaValue = keccak256(abi.encodePacked(this)); shaValue = keccak256(abi.encodePacked(this));
} }
} }
@ -187,7 +187,7 @@ BOOST_AUTO_TEST_CASE(updating_store)
contract test { contract test {
uint data; uint data;
uint data2; uint data2;
constructor() public { constructor() {
data = 1; data = 1;
data = 2; data = 2;
data2 = 0; data2 = 0;

View File

@ -36,7 +36,7 @@ BOOST_AUTO_TEST_CASE(does_not_include_creation_time_only_internal_functions)
char const* sourceCode = R"( char const* sourceCode = R"(
contract C { contract C {
uint x; uint x;
constructor() public { f(); } constructor() { f(); }
function f() internal { for (uint i = 0; i < 10; ++i) x += 3 + i; } function f() internal { for (uint i = 0; i < 10; ++i) x += 3 + i; }
} }
)"; )";

View File

@ -980,7 +980,7 @@ BOOST_AUTO_TEST_CASE(constructor)
char const* sourceCode = R"( char const* sourceCode = R"(
contract test { contract test {
mapping(uint => uint) data; mapping(uint => uint) data;
constructor() public { constructor() {
data[7] = 8; data[7] = 8;
} }
function get(uint key) public returns (uint value) { function get(uint key) public returns (uint value) {
@ -1007,7 +1007,7 @@ BOOST_AUTO_TEST_CASE(blockchain)
{ {
char const* sourceCode = R"( char const* sourceCode = R"(
contract test { contract test {
constructor() public payable {} constructor() payable {}
function someInfo() public payable returns (uint256 value, address coinbase, uint256 blockNumber) { function someInfo() public payable returns (uint256 value, address coinbase, uint256 blockNumber) {
value = msg.value; value = msg.value;
coinbase = block.coinbase; coinbase = block.coinbase;
@ -1029,7 +1029,7 @@ BOOST_AUTO_TEST_CASE(send_ether)
{ {
char const* sourceCode = R"( char const* sourceCode = R"(
contract test { contract test {
constructor() payable public {} constructor() payable {}
function a(address payable addr, uint amount) public returns (uint ret) { function a(address payable addr, uint amount) public returns (uint ret) {
addr.send(amount); addr.send(amount);
return address(this).balance; return address(this).balance;
@ -1049,7 +1049,7 @@ BOOST_AUTO_TEST_CASE(transfer_ether)
{ {
char const* sourceCode = R"( char const* sourceCode = R"(
contract A { contract A {
constructor() public payable {} constructor() payable {}
function a(address payable addr, uint amount) public returns (uint) { function a(address payable addr, uint amount) public returns (uint) {
addr.transfer(amount); addr.transfer(amount);
return address(this).balance; return address(this).balance;
@ -1205,7 +1205,7 @@ BOOST_AUTO_TEST_CASE(log_in_constructor)
{ {
char const* sourceCode = R"( char const* sourceCode = R"(
contract test { contract test {
constructor() public { constructor() {
log1(bytes32(uint256(1)), bytes32(uint256(2))); log1(bytes32(uint256(1)), bytes32(uint256(2)));
} }
} }
@ -1224,7 +1224,7 @@ BOOST_AUTO_TEST_CASE(selfdestruct)
{ {
char const* sourceCode = R"( char const* sourceCode = R"(
contract test { contract test {
constructor() public payable {} constructor() payable {}
function a(address payable receiver) public returns (uint ret) { function a(address payable receiver) public returns (uint ret) {
selfdestruct(receiver); selfdestruct(receiver);
return 10; return 10;
@ -1613,7 +1613,7 @@ BOOST_AUTO_TEST_CASE(constructor_with_long_arguments)
string public a; string public a;
string public b; string public b;
constructor(string memory _a, string memory _b) public { constructor(string memory _a, string memory _b) {
a = _a; a = _a;
b = _b; b = _b;
} }
@ -1642,7 +1642,7 @@ BOOST_AUTO_TEST_CASE(contracts_as_addresses)
} }
contract test { contract test {
helper h; helper h;
constructor() public payable { h = new helper(); address(h).send(5); } constructor() payable { h = new helper(); address(h).send(5); }
function getBalance() public returns (uint256 myBalance, uint256 helperBalance) { function getBalance() public returns (uint256 myBalance, uint256 helperBalance) {
myBalance = address(this).balance; myBalance = address(this).balance;
helperBalance = address(h).balance; helperBalance = address(h).balance;
@ -1719,8 +1719,8 @@ BOOST_AUTO_TEST_CASE(blockhash)
BOOST_AUTO_TEST_CASE(internal_constructor) BOOST_AUTO_TEST_CASE(internal_constructor)
{ {
char const* sourceCode = R"( char const* sourceCode = R"(
contract C { abstract contract C {
constructor() internal {} constructor() {}
} }
)"; )";
BOOST_CHECK(compileAndRunWithoutCheck({{"", sourceCode}}, 0, "C").empty()); BOOST_CHECK(compileAndRunWithoutCheck({{"", sourceCode}}, 0, "C").empty());
@ -2378,7 +2378,7 @@ BOOST_AUTO_TEST_CASE(generic_call)
function recv(uint256 x) public payable { received = x; } function recv(uint256 x) public payable { received = x; }
} }
contract sender { contract sender {
constructor() public payable {} constructor() payable {}
function doSend(address rec) public returns (uint d) function doSend(address rec) public returns (uint d)
{ {
bytes4 signature = bytes4(bytes32(keccak256("recv(uint256)"))); bytes4 signature = bytes4(bytes32(keccak256("recv(uint256)")));
@ -2401,14 +2401,14 @@ BOOST_AUTO_TEST_CASE(generic_delegatecall)
uint public received; uint public received;
address public sender; address public sender;
uint public value; uint public value;
constructor() public payable {} constructor() payable {}
function recv(uint256 x) public payable { received = x; sender = msg.sender; value = msg.value; } function recv(uint256 x) public payable { received = x; sender = msg.sender; value = msg.value; }
} }
contract Sender { contract Sender {
uint public received; uint public received;
address public sender; address public sender;
uint public value; uint public value;
constructor() public payable {} constructor() payable {}
function doSend(address rec) public payable function doSend(address rec) public payable
{ {
bytes4 signature = bytes4(bytes32(keccak256("recv(uint256)"))); bytes4 signature = bytes4(bytes32(keccak256("recv(uint256)")));
@ -2449,7 +2449,7 @@ BOOST_AUTO_TEST_CASE(generic_staticcall)
char const* sourceCode = R"**( char const* sourceCode = R"**(
contract A { contract A {
uint public x; uint public x;
constructor() public { x = 42; } constructor() { x = 42; }
function pureFunction(uint256 p) public pure returns (uint256) { return p; } function pureFunction(uint256 p) public pure returns (uint256) { return p; }
function viewFunction(uint256 p) public view returns (uint256) { return p + x; } function viewFunction(uint256 p) public view returns (uint256) { return p + x; }
function nonpayableFunction(uint256 p) public returns (uint256) { x = p; return x; } function nonpayableFunction(uint256 p) public returns (uint256) { x = p; return x; }
@ -2584,7 +2584,7 @@ BOOST_AUTO_TEST_CASE(call_forward_bytes)
fallback() external { received = 0x80; } fallback() external { received = 0x80; }
} }
contract sender { contract sender {
constructor() public { rec = new receiver(); } constructor() { rec = new receiver(); }
fallback() external { savedData = msg.data; } fallback() external { savedData = msg.data; }
function forward() public returns (bool) { address(rec).call(savedData); return true; } function forward() public returns (bool) { address(rec).call(savedData); return true; }
function clear() public returns (bool) { delete savedData; return true; } function clear() public returns (bool) { delete savedData; return true; }
@ -2613,7 +2613,7 @@ BOOST_AUTO_TEST_CASE(call_forward_bytes_length)
} }
contract sender { contract sender {
receiver rec; receiver rec;
constructor() public { rec = new receiver(); } constructor() { rec = new receiver(); }
function viaCalldata() public returns (uint) { function viaCalldata() public returns (uint) {
(bool success,) = address(rec).call(msg.data); (bool success,) = address(rec).call(msg.data);
require(success); require(success);
@ -2657,7 +2657,7 @@ BOOST_AUTO_TEST_CASE(copying_bytes_multiassign)
fallback() external { received = 0x80; } fallback() external { received = 0x80; }
} }
contract sender { contract sender {
constructor() public { rec = new receiver(); } constructor() { rec = new receiver(); }
fallback() external { savedData1 = savedData2 = msg.data; } fallback() external { savedData1 = savedData2 = msg.data; }
function forward(bool selector) public returns (bool) { function forward(bool selector) public returns (bool) {
if (selector) { address(rec).call(savedData1); delete savedData1; } if (selector) { address(rec).call(savedData1); delete savedData1; }
@ -3609,7 +3609,7 @@ BOOST_AUTO_TEST_CASE(evm_exceptions_in_constructor_out_of_baund)
contract A { contract A {
uint public test = 1; uint public test = 1;
uint[3] arr; uint[3] arr;
constructor() public constructor()
{ {
uint index = 5; uint index = 5;
test = arr[index]; test = arr[index];
@ -3631,7 +3631,7 @@ BOOST_AUTO_TEST_CASE(failing_send)
} }
} }
contract Main { contract Main {
constructor() public payable {} constructor() payable {}
function callHelper(address payable _a) public returns (bool r, uint bal) { function callHelper(address payable _a) public returns (bool r, uint bal) {
r = !_a.send(5); r = !_a.send(5);
bal = address(this).balance; bal = address(this).balance;
@ -3856,7 +3856,7 @@ BOOST_AUTO_TEST_CASE(bytes_in_constructors_unpacker)
contract Test { contract Test {
uint public m_x; uint public m_x;
bytes public m_s; bytes public m_s;
constructor(uint x, bytes memory s) public { constructor(uint x, bytes memory s) {
m_x = x; m_x = x;
m_s = s; m_s = s;
} }
@ -3877,7 +3877,7 @@ BOOST_AUTO_TEST_CASE(bytes_in_constructors_packer)
contract Base { contract Base {
uint public m_x; uint public m_x;
bytes m_s; bytes m_s;
constructor(uint x, bytes memory s) public { constructor(uint x, bytes memory s) {
m_x = x; m_x = x;
m_s = s; m_s = s;
} }
@ -3886,7 +3886,7 @@ BOOST_AUTO_TEST_CASE(bytes_in_constructors_packer)
} }
} }
contract Main is Base { contract Main is Base {
constructor(bytes memory s, uint x) Base(x, f(s)) public {} constructor(bytes memory s, uint x) Base(x, f(s)) {}
function f(bytes memory s) public returns (bytes memory) { function f(bytes memory s) public returns (bytes memory) {
return s; return s;
} }
@ -3916,7 +3916,7 @@ BOOST_AUTO_TEST_CASE(arrays_in_constructors)
contract Base { contract Base {
uint public m_x; uint public m_x;
address[] m_s; address[] m_s;
constructor(uint x, address[] memory s) public { constructor(uint x, address[] memory s) {
m_x = x; m_x = x;
m_s = s; m_s = s;
} }
@ -3925,7 +3925,7 @@ BOOST_AUTO_TEST_CASE(arrays_in_constructors)
} }
} }
contract Main is Base { contract Main is Base {
constructor(address[] memory s, uint x) Base(x, f(s)) public {} constructor(address[] memory s, uint x) Base(x, f(s)) {}
function f(address[] memory s) public returns (address[] memory) { function f(address[] memory s) public returns (address[] memory) {
return s; return s;
} }
@ -4468,7 +4468,7 @@ BOOST_AUTO_TEST_CASE(constant_string_literal)
bytes32 constant public b = "abcdefghijklmnopq"; bytes32 constant public b = "abcdefghijklmnopq";
string constant public x = "abefghijklmnopqabcdefghijklmnopqabcdefghijklmnopqabca"; string constant public x = "abefghijklmnopqabcdefghijklmnopqabcdefghijklmnopqabca";
constructor() public { constructor() {
string memory xx = x; string memory xx = x;
bytes32 bb = b; bytes32 bb = b;
} }
@ -4969,7 +4969,7 @@ BOOST_AUTO_TEST_CASE(calldata_offset)
{ {
address[] _arr; address[] _arr;
string public last = "nd"; string public last = "nd";
constructor(address[] memory guardians) public constructor(address[] memory guardians)
{ {
_arr = guardians; _arr = guardians;
} }
@ -4984,7 +4984,7 @@ BOOST_AUTO_TEST_CASE(reject_ether_sent_to_library)
char const* sourceCode = R"( char const* sourceCode = R"(
library lib {} library lib {}
contract c { contract c {
constructor() public payable {} constructor() payable {}
function f(address payable x) public returns (bool) { function f(address payable x) public returns (bool) {
return x.send(1); return x.send(1);
} }
@ -5203,10 +5203,10 @@ BOOST_AUTO_TEST_CASE(index_access_with_type_conversion)
BOOST_AUTO_TEST_CASE(failed_create) BOOST_AUTO_TEST_CASE(failed_create)
{ {
char const* sourceCode = R"( char const* sourceCode = R"(
contract D { constructor() public payable {} } contract D { constructor() payable {} }
contract C { contract C {
uint public x; uint public x;
constructor() public payable {} constructor() payable {}
function f(uint amount) public returns (D) { function f(uint amount) public returns (D) {
x++; x++;
return (new D){value: amount}(); return (new D){value: amount}();
@ -5235,7 +5235,7 @@ BOOST_AUTO_TEST_CASE(correctly_initialize_memory_array_in_constructor)
char const* sourceCode = R"( char const* sourceCode = R"(
contract C { contract C {
bool public success; bool public success;
constructor() public { constructor() {
// Make memory dirty. // Make memory dirty.
assembly { assembly {
for { let i := 0 } lt(i, 64) { i := add(i, 1) } { for { let i := 0 } lt(i, 64) { i := add(i, 1) } {
@ -5272,7 +5272,7 @@ BOOST_AUTO_TEST_CASE(mutex)
} }
contract Fund is mutexed { contract Fund is mutexed {
uint shares; uint shares;
constructor() public payable { shares = msg.value; } constructor() payable { shares = msg.value; }
function withdraw(uint amount) public protected returns (uint) { function withdraw(uint amount) public protected returns (uint) {
// NOTE: It is very bad practice to write this function this way. // NOTE: It is very bad practice to write this function this way.
// Please refer to the documentation of how to do this properly. // Please refer to the documentation of how to do this properly.
@ -5297,7 +5297,7 @@ BOOST_AUTO_TEST_CASE(mutex)
uint callDepth; uint callDepth;
bool protected; bool protected;
function setProtected(bool _protected) public { protected = _protected; } function setProtected(bool _protected) public { protected = _protected; }
constructor(Fund _fund) public { fund = _fund; } constructor(Fund _fund) { fund = _fund; }
function attack() public returns (uint) { function attack() public returns (uint) {
callDepth = 0; callDepth = 0;
return attackInternal(); return attackInternal();
@ -5537,7 +5537,7 @@ BOOST_AUTO_TEST_CASE(include_creation_bytecode_only_once)
contract D { contract D {
bytes a = hex"1237651237125387136581271652831736512837126583171583712358126123765123712538713658127165283173651283712658317158371235812612376512371253871365812716528317365128371265831715837123581261237651237125387136581271652831736512837126583171583712358126"; bytes a = hex"1237651237125387136581271652831736512837126583171583712358126123765123712538713658127165283173651283712658317158371235812612376512371253871365812716528317365128371265831715837123581261237651237125387136581271652831736512837126583171583712358126";
bytes b = hex"1237651237125327136581271252831736512837126583171383712358126123765125712538713658127165253173651283712658357158371235812612376512371a5387136581271652a317365128371265a317158371235812612a765123712538a13658127165a83173651283712a58317158371235a126"; bytes b = hex"1237651237125327136581271252831736512837126583171383712358126123765125712538713658127165253173651283712658357158371235812612376512371a5387136581271652a317365128371265a317158371235812612a765123712538a13658127165a83173651283712a58317158371235a126";
constructor(uint) public {} constructor(uint) {}
} }
contract Double { contract Double {
function f() public { function f() public {
@ -5783,7 +5783,7 @@ BOOST_AUTO_TEST_CASE(bubble_up_error_messages_through_create)
{ {
char const* sourceCode = R"( char const* sourceCode = R"(
contract E { contract E {
constructor() public { constructor() {
revert("message"); revert("message");
} }
} }
@ -5897,7 +5897,7 @@ BOOST_AUTO_TEST_CASE(bare_call_return_data)
{ {
string sourceCode = R"DELIMITER( string sourceCode = R"DELIMITER(
contract A { contract A {
constructor() public { constructor() {
} }
function return_bool() public pure returns(bool) { function return_bool() public pure returns(bool) {
return true; return true;
@ -5928,7 +5928,7 @@ BOOST_AUTO_TEST_CASE(bare_call_return_data)
} }
contract C { contract C {
A addr; A addr;
constructor() public { constructor() {
addr = new A(); addr = new A();
} }
function f(string memory signature) public returns (bool, bytes memory) { function f(string memory signature) public returns (bool, bytes memory) {
@ -6259,7 +6259,7 @@ BOOST_AUTO_TEST_CASE(abi_encodePackedV2_structs)
} }
S s; S s;
event E(S indexed); event E(S indexed);
constructor() public { constructor() {
s.a = 0x12; s.a = 0x12;
s.b = -7; s.b = -7;
s.c[0] = 2; s.c[0] = 2;
@ -6324,7 +6324,7 @@ BOOST_AUTO_TEST_CASE(abi_encodePackedV2_arrayOfStrings)
contract C { contract C {
string[] x; string[] x;
event E(string[] indexed); event E(string[] indexed);
constructor() public { constructor() {
x.push("abc"); x.push("abc");
x.push("0123456789012345678901234567890123456789"); x.push("0123456789012345678901234567890123456789");
} }
@ -6367,7 +6367,7 @@ BOOST_AUTO_TEST_CASE(event_signature_in_library)
} }
} }
contract C { contract C {
constructor() public { constructor() {
L.f(); L.f();
} }
} }
@ -6695,7 +6695,7 @@ BOOST_AUTO_TEST_CASE(dirty_scratch_space_prior_to_constant_optimiser)
char const* sourceCode = R"( char const* sourceCode = R"(
contract C { contract C {
event X(uint); event X(uint);
constructor() public { constructor() {
assembly { assembly {
// make scratch space dirty // make scratch space dirty
mstore(0, 0x4242424242424242424242424242424242424242424242424242424242424242) mstore(0, 0x4242424242424242424242424242424242424242424242424242424242424242)

View File

@ -97,7 +97,7 @@ BOOST_AUTO_TEST_CASE(implement_abstract_via_constructor)
SourceUnit const* sourceUnit = nullptr; SourceUnit const* sourceUnit = nullptr;
char const* text = R"( char const* text = R"(
abstract contract base { function foo() public virtual; } abstract contract base { function foo() public virtual; }
abstract contract foo is base { constructor() public {} } abstract contract foo is base { constructor() {} }
)"; )";
sourceUnit = parseAndAnalyse(text); sourceUnit = parseAndAnalyse(text);
std::vector<ASTPointer<ASTNode>> nodes = sourceUnit->nodes(); std::vector<ASTPointer<ASTNode>> nodes = sourceUnit->nodes();

View File

@ -1070,7 +1070,7 @@ BOOST_AUTO_TEST_CASE(user_constructor)
char const* sourceCode = R"( char const* sourceCode = R"(
contract test { contract test {
/// @notice this is a really nice constructor /// @notice this is a really nice constructor
constructor(uint a, uint second) public { } constructor(uint a, uint second) { }
} }
)"; )";
@ -1090,7 +1090,7 @@ BOOST_AUTO_TEST_CASE(user_constructor_and_function)
char const* sourceCode = R"( char const* sourceCode = R"(
contract test { contract test {
/// @notice this is a really nice constructor /// @notice this is a really nice constructor
constructor(uint a, uint second) public { } constructor(uint a, uint second) { }
/// another multiplier /// another multiplier
function mul(uint a, uint second) public returns(uint d) { return a * 7 + second; } function mul(uint a, uint second) public returns(uint d) { return a * 7 + second; }
} }
@ -1117,7 +1117,7 @@ BOOST_AUTO_TEST_CASE(dev_constructor)
/// @author Alex /// @author Alex
/// @param a the parameter a is really nice and very useful /// @param a the parameter a is really nice and very useful
/// @param second the second parameter is not very useful, it just provides additional confusion /// @param second the second parameter is not very useful, it just provides additional confusion
constructor(uint a, uint second) public { } constructor(uint a, uint second) { }
} }
)"; )";
@ -1144,7 +1144,7 @@ BOOST_AUTO_TEST_CASE(dev_constructor_return)
/// @param a the parameter a is really nice and very useful /// @param a the parameter a is really nice and very useful
/// @param second the second parameter is not very useful, it just provides additional confusion /// @param second the second parameter is not very useful, it just provides additional confusion
/// @return return should not work within constructors /// @return return should not work within constructors
constructor(uint a, uint second) public { } constructor(uint a, uint second) { }
} }
)"; )";
@ -1158,7 +1158,7 @@ BOOST_AUTO_TEST_CASE(dev_constructor_and_function)
/// @author Alex /// @author Alex
/// @param a the parameter a is really nice and very useful /// @param a the parameter a is really nice and very useful
/// @param second the second parameter is not very useful, it just provides additional confusion /// @param second the second parameter is not very useful, it just provides additional confusion
constructor(uint a, uint second) public { } constructor(uint a, uint second) { }
/// @dev Multiplies a number by 7 and adds second parameter /// @dev Multiplies a number by 7 and adds second parameter
/// @param a Documentation for the first parameter starts here. /// @param a Documentation for the first parameter starts here.
/// Since it's a really complicated parameter we need 2 lines /// Since it's a really complicated parameter we need 2 lines

View File

@ -378,7 +378,7 @@ BOOST_AUTO_TEST_CASE(computing_constants)
uint m_b; uint m_b;
uint m_c; uint m_c;
uint m_d; uint m_d;
constructor() public { constructor() {
set(); set();
} }
function set() public returns (uint) { function set() public returns (uint) {
@ -562,7 +562,7 @@ BOOST_AUTO_TEST_CASE(dead_code_elimination_across_assemblies)
char const* sourceCode = R"( char const* sourceCode = R"(
contract DCE { contract DCE {
function () internal returns (uint) stored; function () internal returns (uint) stored;
constructor() public { constructor() {
stored = f; stored = f;
} }
function f() internal returns (uint) { return 7; } function f() internal returns (uint) { return 7; }

View File

@ -1,7 +1,7 @@
pragma solidity >=0.0.0; pragma solidity >=0.0.0;
contract Error1 { contract Error1 {
constructor() public { constructor() {
balances[tx.origin] = ; // missing RHS. balances[tx.origin] = ; // missing RHS.
} }
@ -16,5 +16,5 @@ contract Error1 {
} }
} }
// ---- // ----
// ParserError 6933: (95-96): Expected primary expression. // ParserError 6933: (88-89): Expected primary expression.
// Warning 3347: (95-96): Recovered in Statement at ';'. // Warning 3347: (88-89): Recovered in Statement at ';'.

View File

@ -1,11 +1,11 @@
pragma solidity >=0.0.0; pragma solidity >=0.0.0;
contract Error3 { contract Error3 {
constructor() public { constructor() {
balances[tx.origin] = ; // missing RHS. balances[tx.origin] = ; // missing RHS.
} }
} }
// ---- // ----
// ParserError 6933: (95-96): Expected primary expression. // ParserError 6933: (88-89): Expected primary expression.
// Warning 3347: (95-96): Recovered in Statement at ';'. // Warning 3347: (88-89): Recovered in Statement at ';'.

View File

@ -6,7 +6,7 @@
pragma solidity >=0.0.0; pragma solidity >=0.0.0;
contract Error4 { contract Error4 {
constructor() public { constructor() {
balances[tx.origin] = 1 2; // missing operator balances[tx.origin] = 1 2; // missing operator
} }
@ -21,9 +21,9 @@ contract Error4 {
} }
// ---- // ----
// ParserError 6635: (249-250): Expected ';' but got 'Number' // ParserError 6635: (242-243): Expected ';' but got 'Number'
// ParserError 6635: (471-479): Expected ';' but got identifier // ParserError 6635: (464-472): Expected ';' but got identifier
// ParserError 6635: (529-533): Expected ';' but got 'emit' // ParserError 6635: (522-526): Expected ';' but got 'emit'
// ParserError 6635: (577-583): Expected ',' but got 'return' // ParserError 6635: (570-576): Expected ',' but got 'return'
// ParserError 6933: (577-583): Expected primary expression. // ParserError 6933: (570-576): Expected primary expression.
// Warning 3796: (588-589): Recovered in Statement at ';'. // Warning 3796: (581-582): Recovered in Statement at ';'.

View File

@ -2,7 +2,7 @@ contract C {
uint256 constant LEN = 3; uint256 constant LEN = 3;
uint256[LEN] public a; uint256[LEN] public a;
constructor(uint256[LEN] memory _a) public { constructor(uint256[LEN] memory _a) {
a = _a; a = _a;
} }
} }

View File

@ -2,7 +2,7 @@ contract Creator {
uint256 public r; uint256 public r;
address public ch; address public ch;
constructor(address[3] memory s, uint256 x) public { constructor(address[3] memory s, uint256 x) {
r = x; r = x;
ch = s[2]; ch = s[2];
} }

View File

@ -2,7 +2,7 @@
contract Helper { contract Helper {
uint256 public flag; uint256 public flag;
constructor(uint256 x) public { constructor(uint256 x) {
flag = x; flag = x;
} }
} }

View File

@ -7,7 +7,7 @@ contract Sample {
} }
s[2] public p; s[2] public p;
constructor() public { constructor() {
s memory m; s memory m;
m.x = 0xbbbb; m.x = 0xbbbb;
m.y = 0xcccc; m.y = 0xcccc;

View File

@ -8,7 +8,7 @@ contract buggystruct {
string last; string last;
} }
constructor() public { constructor() {
bug = Buggy(10, 20, 30, "asdfghjkl"); bug = Buggy(10, 20, 30, "asdfghjkl");
} }

View File

@ -1,6 +1,6 @@
contract C { contract C {
function(bytes calldata) returns (byte) x; function(bytes calldata) returns (byte) x;
constructor() public { x = f; } constructor() { x = f; }
function f(bytes calldata b) internal pure returns (byte) { function f(bytes calldata b) internal pure returns (byte) {
return b[2]; return b[2];
} }

View File

@ -1,14 +1,14 @@
contract BaseBase { contract BaseBase {
uint256 m_a; uint256 m_a;
constructor(uint256 a) public { constructor(uint256 a) {
m_a = a; m_a = a;
} }
} }
contract Base is BaseBase(7) { contract Base is BaseBase(7) {
constructor() public { constructor() {
m_a *= m_a; m_a *= m_a;
} }
} }

View File

@ -1,12 +1,12 @@
contract A1 { constructor() public {} } contract A1 { constructor() {} }
contract B1 is A1 {} contract B1 is A1 {}
contract A2 { constructor() public payable {} } contract A2 { constructor() payable {} }
contract B2 is A2 {} contract B2 is A2 {}
contract B3 {} contract B3 {}
contract B4 { constructor() public {} } contract B4 { constructor() {} }
contract C { contract C {
function createWithValue(bytes memory c, uint256 value) public payable returns (bool) { function createWithValue(bytes memory c, uint256 value) public payable returns (bool) {

View File

@ -2,7 +2,7 @@ contract Main {
bytes3 name; bytes3 name;
bool flag; bool flag;
constructor(bytes3 x, bool f) public { constructor(bytes3 x, bool f) {
name = x; name = x;
flag = f; flag = f;
} }

View File

@ -2,7 +2,7 @@ contract Helper {
bytes3 name; bytes3 name;
bool flag; bool flag;
constructor(bytes3 x, bool f) public { constructor(bytes3 x, bool f) {
name = x; name = x;
flag = f; flag = f;
} }
@ -20,7 +20,7 @@ contract Helper {
contract Main { contract Main {
Helper h; Helper h;
constructor() public { constructor() {
h = new Helper("abc", true); h = new Helper("abc", true);
} }

View File

@ -2,7 +2,7 @@ contract C {
uint256 public a; uint256 public a;
uint256[3] public b; uint256[3] public b;
constructor(uint256 _a, uint256[3] memory _b) public { constructor(uint256 _a, uint256[3] memory _b) {
a = _a; a = _a;
b = _b; b = _b;
} }

View File

@ -1,5 +1,5 @@
contract A { contract A {
constructor() public { constructor() {
address(this).call("123"); address(this).call("123");
} }
} }

View File

@ -1,7 +1,7 @@
contract BaseBase { contract BaseBase {
uint256 m_a; uint256 m_a;
constructor(uint256 a) public { constructor(uint256 a) {
m_a = a; m_a = a;
} }

View File

@ -2,7 +2,7 @@ contract Test {
bytes3 name; bytes3 name;
bool flag; bool flag;
constructor() public { constructor() {
setName("abc"); setName("abc");
} }

View File

@ -1,7 +1,7 @@
contract Test { contract Test {
bytes6 name; bytes6 name;
constructor() public { constructor() {
function (bytes6 _name) internal setter = setName; function (bytes6 _name) internal setter = setName;
setter("abcdef"); setter("abcdef");

View File

@ -1,10 +1,10 @@
contract A1 {} contract A1 {}
contract B1 is A1 { constructor() public payable {} } contract B1 is A1 { constructor() payable {} }
contract A2 { constructor() public {} } contract A2 { constructor() {} }
contract B2 is A2 { constructor() public payable {} } contract B2 is A2 { constructor() payable {} }
contract B3 { constructor() public payable {} } contract B3 { constructor() payable {} }
contract C { contract C {
function f() public payable returns (bool) { function f() public payable returns (bool) {

View File

@ -1,5 +1,5 @@
contract C { contract C {
constructor() public payable {} constructor() payable {}
} }
// ==== // ====

View File

@ -2,7 +2,7 @@ contract C {
uint256 public result_in_constructor; uint256 public result_in_constructor;
function(uint256) returns (uint256) internal x; function(uint256) returns (uint256) internal x;
constructor() public { constructor() {
x = double; x = double;
result_in_constructor = use(2); result_in_constructor = use(2);
} }

View File

@ -1,7 +1,7 @@
contract C { contract C {
function() returns (uint256) internal x; function() returns (uint256) internal x;
constructor() public { constructor() {
x = unused; x = unused;
} }

View File

@ -8,7 +8,7 @@ library L {
contract C { contract C {
function() returns (uint256) internal x; function() returns (uint256) internal x;
constructor() public { constructor() {
x = L.x; x = L.x;
} }

View File

@ -1,6 +1,6 @@
contract A { contract A {
uint x; uint x;
constructor() public { constructor() {
x = 42; x = 42;
} }
function f() public returns(uint256) { function f() public returns(uint256) {

View File

@ -2,7 +2,7 @@ contract C {
uint public i; uint public i;
uint public k; uint public k;
constructor(uint newI, uint newK) public { constructor(uint newI, uint newK) {
i = newI; i = newI;
k = newK; k = newK;
} }

View File

@ -2,22 +2,22 @@ contract A {
uint public i; uint public i;
uint public k; uint public k;
constructor(uint newI, uint newK) public { constructor(uint newI, uint newK) {
i = newI; i = newI;
k = newK; k = newK;
} }
} }
abstract contract B is A { abstract contract B is A {
uint public j; uint public j;
constructor(uint newJ) public { constructor(uint newJ) {
j = newJ; j = newJ;
} }
} }
contract C is A { contract C is A {
constructor(uint newI, uint newK) A(newI, newK) public {} constructor(uint newI, uint newK) A(newI, newK) {}
} }
contract D is B, C { contract D is B, C {
constructor(uint newI, uint newK) B(newI) C(newI, newK + 1) public {} constructor(uint newI, uint newK) B(newI) C(newI, newK + 1) {}
} }
// ==== // ====
// compileViaYul: also // compileViaYul: also

View File

@ -2,13 +2,13 @@ contract C {
uint public i; uint public i;
uint public k; uint public k;
constructor(uint newI, uint newK) public { constructor(uint newI, uint newK) {
i = newI; i = newI;
k = newK; k = newK;
} }
} }
contract D is C { contract D is C {
constructor(uint newI, uint newK) C(newI, newK + 1) public {} constructor(uint newI, uint newK) C(newI, newK + 1) {}
} }
// ==== // ====
// compileViaYul: also // compileViaYul: also

View File

@ -2,7 +2,7 @@ contract C {
uint public i; uint public i;
uint public k; uint public k;
constructor(uint newI, uint newK) public { constructor(uint newI, uint newK) {
i = newI; i = newI;
k = newK; k = newK;
} }

View File

@ -1,7 +1,7 @@
contract test { contract test {
enum ActionChoices {GoLeft, GoRight, GoStraight} enum ActionChoices {GoLeft, GoRight, GoStraight}
constructor() public {} constructor() {}
function getChoiceExp(uint256 x) public returns (uint256 d) { function getChoiceExp(uint256 x) public returns (uint256 d) {
choice = ActionChoices(x); choice = ActionChoices(x);

View File

@ -1,7 +1,7 @@
contract test { contract test {
enum ActionChoices {GoLeft, GoRight, GoStraight, Sit} enum ActionChoices {GoLeft, GoRight, GoStraight, Sit}
constructor() public { constructor() {
choices = ActionChoices.GoStraight; choices = ActionChoices.GoStraight;
} }

View File

@ -1,6 +1,6 @@
contract C { contract C {
uint public i; uint public i;
constructor() public { constructor() {
i = 2; i = 2;
} }
} }

View File

@ -1,12 +1,12 @@
contract C { contract C {
uint public i; uint public i;
constructor(uint newI) public { constructor(uint newI) {
i = newI; i = newI;
} }
} }
contract D { contract D {
C c; C c;
constructor(uint v) public { constructor(uint v) {
c = new C(v); c = new C(v);
} }
function f() public returns (uint r) { function f() public returns (uint r) {

View File

@ -1,12 +1,12 @@
contract C { contract C {
uint public i; uint public i;
constructor(uint newI) public { constructor(uint newI) {
i = newI; i = newI;
} }
} }
contract D { contract D {
C c; C c;
constructor(uint v) public { constructor(uint v) {
c = new C{salt: "abc"}(v); c = new C{salt: "abc"}(v);
} }
function f() public returns (uint r) { function f() public returns (uint r) {

View File

@ -18,7 +18,7 @@ contract helper {
contract test { contract test {
helper h; helper h;
constructor() public payable { constructor() payable {
h = new helper(); h = new helper();
} }

View File

@ -15,7 +15,7 @@ contract helper {
} }
contract test { contract test {
helper h; helper h;
constructor() public payable { constructor() payable {
h = new helper(); h = new helper();
} }

View File

@ -3,7 +3,7 @@ contract test {
bytes6 public name; bytes6 public name;
bytes32 public a_hash; bytes32 public a_hash;
address public an_address; address public an_address;
constructor() public { constructor() {
data = 8; data = 8;
name = "Celina"; name = "Celina";
a_hash = keccak256("\x7b"); a_hash = keccak256("\x7b");

View File

@ -6,7 +6,7 @@ contract Receiver {
contract Main { contract Main {
constructor() public payable {} constructor() payable {}
function s() public returns (bool) { function s() public returns (bool) {
Receiver r = new Receiver(); Receiver r = new Receiver();

View File

@ -15,7 +15,7 @@ contract Flow {
success = true; success = true;
} }
constructor() public { constructor() {
stages[msg.sender] = stage0; stages[msg.sender] = stage0;
} }

View File

@ -1,7 +1,7 @@
contract C { contract C {
uint256 public initial; uint256 public initial;
constructor() public { constructor() {
initial = double(2); initial = double(2);
} }

View File

@ -1,7 +1,7 @@
contract C { contract C {
function(uint256) returns (uint256) internal x; function(uint256) returns (uint256) internal x;
constructor() public { constructor() {
x = double; x = double;
} }

View File

@ -5,7 +5,7 @@ contract C {
} }
mapping(uint256 => Y)[] public m; mapping(uint256 => Y)[] public m;
mapping(uint256 => Y)[3] public n; mapping(uint256 => Y)[3] public n;
constructor() public { constructor() {
m.push(); m.push();
m.push(); m.push();
m[1][0].a = 1; m[1][0].a = 1;

View File

@ -1,6 +1,6 @@
contract C { contract C {
uint8[][2] public a; uint8[][2] public a;
constructor() public { constructor() {
a[1].push(3); a[1].push(3);
a[1].push(4); a[1].push(4);
} }

View File

@ -1,6 +1,6 @@
contract C { contract C {
mapping(uint => mapping(uint => uint)) public x; mapping(uint => mapping(uint => uint)) public x;
constructor() public { constructor() {
x[1][2] = 3; x[1][2] = 3;
} }
} }

View File

@ -5,7 +5,7 @@ contract C {
} }
mapping(uint256 => Y[]) public m; mapping(uint256 => Y[]) public m;
mapping(uint256 => Y[3]) public n; mapping(uint256 => Y[3]) public n;
constructor() public { constructor() {
m[1].push().a = 1; m[1].push().a = 1;
m[1][0].b = 2; m[1][0].b = 2;
m[1].push().a = 3; m[1].push().a = 3;

Some files were not shown because too many files have changed in this diff Show More