mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Update tests.
This commit is contained in:
parent
747aeb4999
commit
9743390a53
@ -2,7 +2,7 @@
|
||||
pragma solidity >=0.6.0;
|
||||
|
||||
contract C {
|
||||
constructor() public {}
|
||||
constructor() {}
|
||||
}
|
||||
contract D is C {
|
||||
}
|
@ -5,10 +5,10 @@ Warning: Source file does not specify required compiler version!
|
||||
--> message_format_utf8/input.sol
|
||||
|
||||
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.
|
||||
--> message_format_utf8/input.sol:6:25:
|
||||
|
@ -1,5 +1,5 @@
|
||||
contract Foo {
|
||||
/* ©©©©ᄅ©©©©© 2017 */ constructor () public { "©©©©ᄅ©©©©©" ; }
|
||||
/* ©©©©ᄅ©©©©© 2017 */ constructor () { "©©©©ᄅ©©©©©" ; }
|
||||
|
||||
function f() public pure {
|
||||
|
||||
|
@ -3,7 +3,7 @@ pragma solidity >=0.0;
|
||||
|
||||
contract C
|
||||
{
|
||||
constructor() public payable
|
||||
constructor() payable
|
||||
{
|
||||
int a;
|
||||
|
||||
|
@ -1,69 +1,69 @@
|
||||
|
||||
======= optimizer_user_yul/input.sol:C =======
|
||||
EVM assembly:
|
||||
/* "optimizer_user_yul/input.sol":60:525 contract C... */
|
||||
/* "optimizer_user_yul/input.sol":60:518 contract C... */
|
||||
mstore(0x40, 0x80)
|
||||
/* "optimizer_user_yul/input.sol":108:113 int a */
|
||||
/* "optimizer_user_yul/input.sol":101:106 int a */
|
||||
0x00
|
||||
/* "optimizer_user_yul/input.sol":188:197 let x,y,z */
|
||||
/* "optimizer_user_yul/input.sol":181:190 let x,y,z */
|
||||
dup1
|
||||
0x00
|
||||
dup1
|
||||
/* "optimizer_user_yul/input.sol":212:213 1 */
|
||||
/* "optimizer_user_yul/input.sol":205:206 1 */
|
||||
0x01
|
||||
/* "optimizer_user_yul/input.sol":209:210 0 */
|
||||
/* "optimizer_user_yul/input.sol":202:203 0 */
|
||||
0x00
|
||||
/* "optimizer_user_yul/input.sol":202:214 sstore(0, 1) */
|
||||
/* "optimizer_user_yul/input.sol":195:207 sstore(0, 1) */
|
||||
sstore
|
||||
/* "optimizer_user_yul/input.sol":219:265 for { } sload(4) { } {... */
|
||||
/* "optimizer_user_yul/input.sol":212:258 for { } sload(4) { } {... */
|
||||
tag_3:
|
||||
/* "optimizer_user_yul/input.sol":233:234 4 */
|
||||
/* "optimizer_user_yul/input.sol":226:227 4 */
|
||||
0x04
|
||||
/* "optimizer_user_yul/input.sol":227:235 sload(4) */
|
||||
/* "optimizer_user_yul/input.sol":220:228 sload(4) */
|
||||
sload
|
||||
/* "optimizer_user_yul/input.sol":219:265 for { } sload(4) { } {... */
|
||||
/* "optimizer_user_yul/input.sol":212:258 for { } sload(4) { } {... */
|
||||
iszero
|
||||
tag_5
|
||||
jumpi
|
||||
pop
|
||||
/* "optimizer_user_yul/input.sol":251:260 exp(x, y) */
|
||||
/* "optimizer_user_yul/input.sol":244:253 exp(x, y) */
|
||||
dup1
|
||||
dup3
|
||||
exp
|
||||
/* "optimizer_user_yul/input.sol":219:265 for { } sload(4) { } {... */
|
||||
/* "optimizer_user_yul/input.sol":212:258 for { } sload(4) { } {... */
|
||||
jump(tag_3)
|
||||
tag_5:
|
||||
/* "optimizer_user_yul/input.sol":223:226 { } */
|
||||
/* "optimizer_user_yul/input.sol":216:219 { } */
|
||||
pop
|
||||
pop
|
||||
pop
|
||||
/* "optimizer_user_yul/input.sol":275:276 2 */
|
||||
/* "optimizer_user_yul/input.sol":268:269 2 */
|
||||
0x02
|
||||
/* "optimizer_user_yul/input.sol":270:276 a := 2 */
|
||||
/* "optimizer_user_yul/input.sol":263:269 a := 2 */
|
||||
swap1
|
||||
pop
|
||||
/* "optimizer_user_yul/input.sol":376:377 3 */
|
||||
/* "optimizer_user_yul/input.sol":369:370 3 */
|
||||
0x03
|
||||
/* "optimizer_user_yul/input.sol":373:374 2 */
|
||||
/* "optimizer_user_yul/input.sol":366:367 2 */
|
||||
0x02
|
||||
/* "optimizer_user_yul/input.sol":366:378 sstore(2, 3) */
|
||||
/* "optimizer_user_yul/input.sol":359:371 sstore(2, 3) */
|
||||
sstore
|
||||
/* "optimizer_user_yul/input.sol":383:516 for { } sload(5) { } {... */
|
||||
/* "optimizer_user_yul/input.sol":376:509 for { } sload(5) { } {... */
|
||||
tag_6:
|
||||
/* "optimizer_user_yul/input.sol":397:398 5 */
|
||||
/* "optimizer_user_yul/input.sol":390:391 5 */
|
||||
0x05
|
||||
/* "optimizer_user_yul/input.sol":391:399 sload(5) */
|
||||
/* "optimizer_user_yul/input.sol":384:392 sload(5) */
|
||||
sload
|
||||
tag_9
|
||||
jumpi
|
||||
jump(tag_8)
|
||||
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)
|
||||
tag_8:
|
||||
/* "optimizer_user_yul/input.sol":347:520 {... */
|
||||
/* "optimizer_user_yul/input.sol":340:513 {... */
|
||||
pop
|
||||
/* "optimizer_user_yul/input.sol":60:525 contract C... */
|
||||
/* "optimizer_user_yul/input.sol":60:518 contract C... */
|
||||
dataSize(sub_0)
|
||||
dup1
|
||||
dataOffset(sub_0)
|
||||
@ -74,7 +74,7 @@ tag_8:
|
||||
stop
|
||||
|
||||
sub_0: assembly {
|
||||
/* "optimizer_user_yul/input.sol":60:525 contract C... */
|
||||
/* "optimizer_user_yul/input.sol":60:518 contract C... */
|
||||
mstore(0x40, 0x80)
|
||||
0x00
|
||||
dup1
|
||||
|
@ -2,7 +2,7 @@
|
||||
pragma solidity >=0.0.0;
|
||||
|
||||
contract Error1 {
|
||||
constructor() public {
|
||||
constructor() {
|
||||
balances[tx.origin] = ; // missing RHS.
|
||||
}
|
||||
|
||||
|
@ -97,7 +97,7 @@ JSON AST:
|
||||
"children": [],
|
||||
"id": 3,
|
||||
"name": "ParameterList",
|
||||
"src": "103:0:0"
|
||||
"src": "96:0:0"
|
||||
},
|
||||
{
|
||||
"attributes":
|
||||
@ -110,12 +110,12 @@ JSON AST:
|
||||
"children": [],
|
||||
"id": 8,
|
||||
"name": "Block",
|
||||
"src": "103:49:0"
|
||||
"src": "96:49:0"
|
||||
}
|
||||
],
|
||||
"id": 9,
|
||||
"name": "FunctionDefinition",
|
||||
"src": "82:70:0"
|
||||
"src": "82:63:0"
|
||||
},
|
||||
{
|
||||
"attributes":
|
||||
@ -147,7 +147,7 @@ JSON AST:
|
||||
"children": [],
|
||||
"id": 10,
|
||||
"name": "ParameterList",
|
||||
"src": "418:2:0"
|
||||
"src": "411:2:0"
|
||||
},
|
||||
{
|
||||
"children":
|
||||
@ -174,17 +174,17 @@ JSON AST:
|
||||
},
|
||||
"id": 11,
|
||||
"name": "ElementaryTypeName",
|
||||
"src": "441:4:0"
|
||||
"src": "434:4:0"
|
||||
}
|
||||
],
|
||||
"id": 12,
|
||||
"name": "VariableDeclaration",
|
||||
"src": "441:4:0"
|
||||
"src": "434:4:0"
|
||||
}
|
||||
],
|
||||
"id": 13,
|
||||
"name": "ParameterList",
|
||||
"src": "440:6:0"
|
||||
"src": "433:6:0"
|
||||
},
|
||||
{
|
||||
"children":
|
||||
@ -210,30 +210,30 @@ JSON AST:
|
||||
},
|
||||
"id": 14,
|
||||
"name": "Literal",
|
||||
"src": "460:1:0"
|
||||
"src": "453:1:0"
|
||||
}
|
||||
],
|
||||
"id": 15,
|
||||
"name": "Return",
|
||||
"src": "453:8:0"
|
||||
"src": "446:8:0"
|
||||
}
|
||||
],
|
||||
"id": 16,
|
||||
"name": "Block",
|
||||
"src": "447:19:0"
|
||||
"src": "440:19:0"
|
||||
}
|
||||
],
|
||||
"id": 17,
|
||||
"name": "FunctionDefinition",
|
||||
"src": "405:61:0"
|
||||
"src": "398:61:0"
|
||||
}
|
||||
],
|
||||
"id": 18,
|
||||
"name": "ContractDefinition",
|
||||
"src": "62:406:0"
|
||||
"src": "62:399:0"
|
||||
}
|
||||
],
|
||||
"id": 19,
|
||||
"name": "SourceUnit",
|
||||
"src": "36:433:0"
|
||||
"src": "36:426:0"
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
{
|
||||
"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 {}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
{"errors":[{"component":"general","errorCode":"3364","formattedMessage":"A:2:112: 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 {}
|
||||
^-------------------^
|
||||
A:2:81: 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 {}
|
||||
^--^
|
||||
A:2:104: 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 {}
|
||||
^--^
|
||||
","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":{}}
|
||||
{"errors":[{"component":"general","errorCode":"3364","formattedMessage":"A:2:105: DeclarationError: Base constructor arguments given twice.
|
||||
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:74: First constructor call is here:
|
||||
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:97: Second constructor call is here:
|
||||
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":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":{}}
|
||||
|
@ -3,5 +3,5 @@ pragma solidity >=0.0;
|
||||
|
||||
contract C
|
||||
{
|
||||
constructor() public {}
|
||||
constructor() {}
|
||||
}
|
||||
|
@ -104,7 +104,6 @@ contract MultiSigWallet {
|
||||
/// @param _owners List of initial owners.
|
||||
/// @param _required Number of required confirmations.
|
||||
constructor(address[] memory _owners, uint _required)
|
||||
public
|
||||
validRequirement(_owners.length, _required)
|
||||
{
|
||||
for (uint i=0; i<_owners.length; i++) {
|
||||
|
@ -20,7 +20,6 @@ contract MultiSigWalletWithDailyLimit is MultiSigWallet {
|
||||
/// @param _required Number of required confirmations.
|
||||
/// @param _dailyLimit Amount in wei, which can be withdrawn without confirmations on a daily basis.
|
||||
constructor(address[] memory _owners, uint _required, uint _dailyLimit)
|
||||
public
|
||||
MultiSigWallet(_owners, _required)
|
||||
{
|
||||
dailyLimit = _dailyLimit;
|
||||
|
@ -50,7 +50,7 @@ contract ico is safeMath {
|
||||
uint256 public totalMint;
|
||||
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.
|
||||
|
||||
|
@ -36,7 +36,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
||||
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 {
|
||||
/*
|
||||
Loading modulest to ModuleHandler.
|
||||
|
@ -12,7 +12,7 @@ contract multiOwner is safeMath {
|
||||
/*
|
||||
Constructor
|
||||
*/
|
||||
constructor(address[] memory newOwners) public {
|
||||
constructor(address[] memory newOwners) {
|
||||
for ( uint256 a=0 ; a<newOwners.length ; a++ ) {
|
||||
_addOwner(newOwners[a]);
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ contract premium is module, safeMath {
|
||||
|
||||
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.
|
||||
If an ICOaddress is defined then the balance of the genesis addresses will be set as well.
|
||||
|
@ -118,7 +118,7 @@ contract provider is module, safeMath, announcementTypes {
|
||||
|
||||
uint256 private currentSchellingRound = 1;
|
||||
|
||||
constructor(address payable _moduleHandler) public {
|
||||
constructor(address payable _moduleHandler) {
|
||||
/*
|
||||
Install function.
|
||||
|
||||
|
@ -61,7 +61,7 @@ contract publisher is announcementTypes, module, safeMath {
|
||||
|
||||
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
|
||||
|
||||
|
@ -45,7 +45,7 @@ contract schellingDB is safeMath, schellingVars {
|
||||
/*
|
||||
Constructor
|
||||
*/
|
||||
constructor() public {
|
||||
constructor() {
|
||||
rounds.push();
|
||||
rounds.push();
|
||||
rounds[0].blockHeight = block.number;
|
||||
@ -249,7 +249,7 @@ contract schelling is module, announcementTypes, schellingVars {
|
||||
bytes1 public belowChar = 0x30;
|
||||
schellingDB private db;
|
||||
|
||||
constructor(address payable _moduleHandler, address _db, bool _forReplace) public {
|
||||
constructor(address payable _moduleHandler, address _db, bool _forReplace) {
|
||||
/*
|
||||
Installation function.
|
||||
|
||||
|
@ -49,7 +49,7 @@ contract token is safeMath, module, announcementTypes {
|
||||
|
||||
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
|
||||
|
||||
|
@ -18,7 +18,6 @@ contract CategoricalEvent is Event {
|
||||
Oracle _oracle,
|
||||
uint8 outcomeCount
|
||||
)
|
||||
public
|
||||
Event(_collateralToken, _oracle, outcomeCount)
|
||||
{
|
||||
|
||||
|
@ -34,7 +34,6 @@ abstract contract Event {
|
||||
/// @param _oracle Oracle contract used to resolve the event
|
||||
/// @param outcomeCount Number of event outcomes
|
||||
constructor(Token _collateralToken, Oracle _oracle, uint8 outcomeCount)
|
||||
public
|
||||
{
|
||||
// Validate input
|
||||
require(address(_collateralToken) != address(0) && address(_oracle) != address(0) && outcomeCount >= 2);
|
||||
|
@ -34,7 +34,6 @@ contract ScalarEvent is Event {
|
||||
int _lowerBound,
|
||||
int _upperBound
|
||||
)
|
||||
public
|
||||
Event(_collateralToken, _oracle, 2)
|
||||
{
|
||||
// Validate bounds
|
||||
|
@ -78,7 +78,6 @@ contract Campaign {
|
||||
uint _funding,
|
||||
uint _deadline
|
||||
)
|
||||
public
|
||||
{
|
||||
// Validate input
|
||||
require( address(_eventContract) != address(0)
|
||||
|
@ -39,7 +39,6 @@ contract StandardMarket is Market {
|
||||
/// @param _marketMaker Market maker contract
|
||||
/// @param _fee Market fee
|
||||
constructor(address _creator, Event _eventContract, MarketMaker _marketMaker, uint24 _fee)
|
||||
public
|
||||
{
|
||||
// Validate inputs
|
||||
require(address(_eventContract) != address(0) && address(_marketMaker) != address(0) && _fee < FEE_RANGE);
|
||||
|
@ -8,7 +8,7 @@ contract Migrations {
|
||||
if (msg.sender == owner) _;
|
||||
}
|
||||
|
||||
constructor() public {
|
||||
constructor() {
|
||||
owner = msg.sender;
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,6 @@ contract CentralizedOracle is Oracle {
|
||||
/// @dev Constructor sets owner address and IPFS hash
|
||||
/// @param _ipfsHash Hash identifying off chain event description
|
||||
constructor(address _owner, bytes memory _ipfsHash)
|
||||
public
|
||||
{
|
||||
// Description hash cannot be null
|
||||
require(_ipfsHash.length == 46);
|
||||
|
@ -23,7 +23,6 @@ contract DifficultyOracle is Oracle {
|
||||
/// @dev Contract constructor validates and sets target block number
|
||||
/// @param _blockNumber Target block number
|
||||
constructor(uint _blockNumber)
|
||||
public
|
||||
{
|
||||
// Block has to be in the future
|
||||
require(_blockNumber > block.number);
|
||||
|
@ -68,7 +68,6 @@ contract FutarchyOracle is Oracle {
|
||||
uint24 fee,
|
||||
uint _deadline
|
||||
)
|
||||
public
|
||||
{
|
||||
// Deadline is in the future
|
||||
require(_deadline > block.timestamp);
|
||||
|
@ -34,7 +34,6 @@ contract FutarchyOracleFactory {
|
||||
/// @dev Constructor sets event factory contract
|
||||
/// @param _eventFactory Event factory contract
|
||||
constructor(EventFactory _eventFactory)
|
||||
public
|
||||
{
|
||||
require(address(_eventFactory) != address(0));
|
||||
eventFactory = _eventFactory;
|
||||
|
@ -17,7 +17,6 @@ contract MajorityOracle is Oracle {
|
||||
/// @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
|
||||
constructor(Oracle[] memory _oracles)
|
||||
public
|
||||
{
|
||||
// At least 2 oracles should be defined
|
||||
require(_oracles.length > 2);
|
||||
|
@ -39,7 +39,6 @@ contract SignedMessageOracle is Oracle {
|
||||
/// @param r Signature parameter
|
||||
/// @param s Signature parameter
|
||||
constructor(bytes32 _descriptionHash, uint8 v, bytes32 r, bytes32 s)
|
||||
public
|
||||
{
|
||||
signer = ecrecover(_descriptionHash, v, r, s);
|
||||
descriptionHash = _descriptionHash;
|
||||
|
@ -54,7 +54,6 @@ contract UltimateOracle is Oracle {
|
||||
uint _challengeAmount,
|
||||
uint _frontRunnerPeriod
|
||||
)
|
||||
public
|
||||
{
|
||||
// Validate inputs
|
||||
require( address(_forwardedOracle) != address(0)
|
||||
|
@ -32,7 +32,6 @@ contract OutcomeToken is StandardToken {
|
||||
*/
|
||||
/// @dev Constructor sets events contract address
|
||||
constructor()
|
||||
public
|
||||
{
|
||||
eventContract = msg.sender;
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ contract MilestoneTracker {
|
||||
address _arbitrator,
|
||||
address _donor,
|
||||
address _recipient
|
||||
) public {
|
||||
) {
|
||||
arbitrator = _arbitrator;
|
||||
donor = _donor;
|
||||
recipient = _recipient;
|
||||
|
@ -114,7 +114,7 @@ contract GlobalRegistrar is Registrar, AuctionSystem {
|
||||
uint constant c_renewalInterval = 365 days;
|
||||
uint constant c_freeBytes = 12;
|
||||
|
||||
constructor() public {
|
||||
constructor() {
|
||||
// TODO: Populate with hall-of-fame.
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,7 @@ contract multiowned {
|
||||
|
||||
// constructor is given number of sigs required to do protected "onlymanyowners" transactions
|
||||
// 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_owners[1] = uint(msg.sender);
|
||||
m_ownerIndex[uint(msg.sender)] = 1;
|
||||
@ -288,7 +288,7 @@ abstract contract daylimit is multiowned {
|
||||
// METHODS
|
||||
|
||||
// constructor - stores initial daily limit and records the present day's index.
|
||||
constructor(uint _limit) public {
|
||||
constructor(uint _limit) {
|
||||
m_dailyLimit = _limit;
|
||||
m_lastDay = today();
|
||||
}
|
||||
@ -369,7 +369,7 @@ contract Wallet is multisig, multiowned, daylimit {
|
||||
|
||||
// constructor - just pass on the owner array to the multiowned and
|
||||
// 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) {
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ abstract contract ManagedAccountInterface {
|
||||
contract ManagedAccount is ManagedAccountInterface{
|
||||
|
||||
// The constructor sets the owner of the account
|
||||
constructor(address _owner, bool _payOwnerOnly) public {
|
||||
constructor(address _owner, bool _payOwnerOnly) {
|
||||
owner = _owner;
|
||||
payOwnerOnly = _payOwnerOnly;
|
||||
}
|
||||
|
@ -318,7 +318,7 @@ BOOST_AUTO_TEST_CASE(decode_from_memory_simple)
|
||||
contract C {
|
||||
uint public _a;
|
||||
uint[] public _b;
|
||||
constructor(uint a, uint[] memory b) public {
|
||||
constructor(uint a, uint[] memory b) {
|
||||
_a = a;
|
||||
_b = b;
|
||||
}
|
||||
@ -343,7 +343,7 @@ BOOST_AUTO_TEST_CASE(decode_function_type)
|
||||
string sourceCode = R"(
|
||||
contract D {
|
||||
function () external returns (uint) public _a;
|
||||
constructor(function () external returns (uint) a) public {
|
||||
constructor(function () external returns (uint) a) {
|
||||
_a = a;
|
||||
}
|
||||
}
|
||||
@ -377,13 +377,13 @@ BOOST_AUTO_TEST_CASE(decode_function_type_array)
|
||||
string sourceCode = R"(
|
||||
contract D {
|
||||
function () external returns (uint)[] public _a;
|
||||
constructor(function () external returns (uint)[] memory a) public {
|
||||
constructor(function () external returns (uint)[] memory a) {
|
||||
_a = a;
|
||||
}
|
||||
}
|
||||
contract E {
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -445,7 +445,7 @@ BOOST_AUTO_TEST_CASE(decode_from_memory_complex)
|
||||
uint public _a;
|
||||
uint[] public _b;
|
||||
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;
|
||||
_b = b;
|
||||
_c = c;
|
||||
|
@ -718,7 +718,7 @@ BOOST_AUTO_TEST_CASE(struct_in_constructor)
|
||||
string c;
|
||||
}
|
||||
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;
|
||||
}
|
||||
S public x;
|
||||
constructor(S memory s) public { x = s; }
|
||||
constructor(S memory s) { x = s; }
|
||||
}
|
||||
|
||||
contract D {
|
||||
@ -771,7 +771,7 @@ BOOST_AUTO_TEST_CASE(struct_in_constructor_data_short)
|
||||
string c;
|
||||
}
|
||||
S public x;
|
||||
constructor(S memory s) public { x = s; }
|
||||
constructor(S memory s) { x = s; }
|
||||
}
|
||||
)";
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
contract test {
|
||||
constructor(uint param1, test param2, bool param3) public {}
|
||||
constructor(uint param1, test param2, bool param3) {}
|
||||
}
|
||||
// ----
|
||||
// :test
|
||||
|
@ -1,7 +1,7 @@
|
||||
// bug #8712
|
||||
contract B {
|
||||
abstract contract B {
|
||||
uint immutable x;
|
||||
constructor(function() internal returns(uint) fp) internal {
|
||||
constructor(function() internal returns(uint) fp) {
|
||||
x = fp(); }
|
||||
}
|
||||
// ----
|
||||
|
@ -1,5 +1,5 @@
|
||||
contract test {
|
||||
constructor(uint param1, test param2, bool param3) public payable {}
|
||||
constructor(uint param1, test param2, bool param3) payable {}
|
||||
}
|
||||
// ----
|
||||
// :test
|
||||
|
@ -1,7 +1,7 @@
|
||||
// bug #1801
|
||||
contract test {
|
||||
enum ActionChoices { GoLeft, GoRight, GoStraight, Sit }
|
||||
constructor(ActionChoices param) public {}
|
||||
constructor(ActionChoices param) {}
|
||||
function ret() public returns (ActionChoices) {
|
||||
ActionChoices action = ActionChoices.GoLeft;
|
||||
return action;
|
||||
|
@ -31,7 +31,7 @@
|
||||
{
|
||||
"id": 3,
|
||||
"nodeType": "Block",
|
||||
"src": "44:4:1",
|
||||
"src": "37:4:1",
|
||||
"statements": []
|
||||
},
|
||||
"id": 4,
|
||||
@ -52,18 +52,18 @@
|
||||
"id": 2,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "44:0:1"
|
||||
"src": "37:0:1"
|
||||
},
|
||||
"scope": 5,
|
||||
"src": "23:25:1",
|
||||
"src": "23:18:1",
|
||||
"stateMutability": "nonpayable",
|
||||
"virtual": false,
|
||||
"visibility": "public"
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"scope": 6,
|
||||
"src": "0:50:1"
|
||||
"src": "0:43:1"
|
||||
}
|
||||
],
|
||||
"src": "0:51:1"
|
||||
"src": "0:44:1"
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
abstract contract C {
|
||||
constructor() public {
|
||||
constructor() {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@
|
||||
"scope": 5,
|
||||
"stateMutability": "nonpayable",
|
||||
"virtual": false,
|
||||
"visibility": "public"
|
||||
"visibility": "internal"
|
||||
},
|
||||
"children":
|
||||
[
|
||||
@ -77,7 +77,7 @@
|
||||
"children": [],
|
||||
"id": 2,
|
||||
"name": "ParameterList",
|
||||
"src": "44:0:1"
|
||||
"src": "37:0:1"
|
||||
},
|
||||
{
|
||||
"attributes":
|
||||
@ -90,20 +90,20 @@
|
||||
"children": [],
|
||||
"id": 3,
|
||||
"name": "Block",
|
||||
"src": "44:4:1"
|
||||
"src": "37:4:1"
|
||||
}
|
||||
],
|
||||
"id": 4,
|
||||
"name": "FunctionDefinition",
|
||||
"src": "23:25:1"
|
||||
"src": "23:18:1"
|
||||
}
|
||||
],
|
||||
"id": 5,
|
||||
"name": "ContractDefinition",
|
||||
"src": "0:50:1"
|
||||
"src": "0:43:1"
|
||||
}
|
||||
],
|
||||
"id": 6,
|
||||
"name": "SourceUnit",
|
||||
"src": "0:51:1"
|
||||
"src": "0:44:1"
|
||||
}
|
||||
|
@ -31,7 +31,7 @@
|
||||
{
|
||||
"id": 3,
|
||||
"nodeType": "Block",
|
||||
"src": "35:4:1",
|
||||
"src": "28:4:1",
|
||||
"statements": []
|
||||
},
|
||||
"id": 4,
|
||||
@ -52,18 +52,18 @@
|
||||
"id": 2,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "35:0:1"
|
||||
"src": "28:0:1"
|
||||
},
|
||||
"scope": 5,
|
||||
"src": "14:25:1",
|
||||
"src": "14:18:1",
|
||||
"stateMutability": "nonpayable",
|
||||
"virtual": false,
|
||||
"visibility": "public"
|
||||
}
|
||||
],
|
||||
"scope": 6,
|
||||
"src": "0:41:1"
|
||||
"src": "0:34:1"
|
||||
}
|
||||
],
|
||||
"src": "0:42:1"
|
||||
"src": "0:35:1"
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
contract C {
|
||||
constructor() public {
|
||||
constructor() {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@
|
||||
"children": [],
|
||||
"id": 2,
|
||||
"name": "ParameterList",
|
||||
"src": "35:0:1"
|
||||
"src": "28:0:1"
|
||||
},
|
||||
{
|
||||
"attributes":
|
||||
@ -90,20 +90,20 @@
|
||||
"children": [],
|
||||
"id": 3,
|
||||
"name": "Block",
|
||||
"src": "35:4:1"
|
||||
"src": "28:4:1"
|
||||
}
|
||||
],
|
||||
"id": 4,
|
||||
"name": "FunctionDefinition",
|
||||
"src": "14:25:1"
|
||||
"src": "14:18:1"
|
||||
}
|
||||
],
|
||||
"id": 5,
|
||||
"name": "ContractDefinition",
|
||||
"src": "0:41:1"
|
||||
"src": "0:34:1"
|
||||
}
|
||||
],
|
||||
"id": 6,
|
||||
"name": "SourceUnit",
|
||||
"src": "0:42:1"
|
||||
"src": "0:35:1"
|
||||
}
|
||||
|
@ -173,7 +173,7 @@ BOOST_AUTO_TEST_CASE(store_keccak256)
|
||||
char const* sourceCode = R"(
|
||||
contract test {
|
||||
bytes32 public shaValue;
|
||||
constructor() public {
|
||||
constructor() {
|
||||
shaValue = keccak256(abi.encodePacked(this));
|
||||
}
|
||||
}
|
||||
@ -187,7 +187,7 @@ BOOST_AUTO_TEST_CASE(updating_store)
|
||||
contract test {
|
||||
uint data;
|
||||
uint data2;
|
||||
constructor() public {
|
||||
constructor() {
|
||||
data = 1;
|
||||
data = 2;
|
||||
data2 = 0;
|
||||
|
@ -36,7 +36,7 @@ BOOST_AUTO_TEST_CASE(does_not_include_creation_time_only_internal_functions)
|
||||
char const* sourceCode = R"(
|
||||
contract C {
|
||||
uint x;
|
||||
constructor() public { f(); }
|
||||
constructor() { f(); }
|
||||
function f() internal { for (uint i = 0; i < 10; ++i) x += 3 + i; }
|
||||
}
|
||||
)";
|
||||
|
@ -980,7 +980,7 @@ BOOST_AUTO_TEST_CASE(constructor)
|
||||
char const* sourceCode = R"(
|
||||
contract test {
|
||||
mapping(uint => uint) data;
|
||||
constructor() public {
|
||||
constructor() {
|
||||
data[7] = 8;
|
||||
}
|
||||
function get(uint key) public returns (uint value) {
|
||||
@ -1007,7 +1007,7 @@ BOOST_AUTO_TEST_CASE(blockchain)
|
||||
{
|
||||
char const* sourceCode = R"(
|
||||
contract test {
|
||||
constructor() public payable {}
|
||||
constructor() payable {}
|
||||
function someInfo() public payable returns (uint256 value, address coinbase, uint256 blockNumber) {
|
||||
value = msg.value;
|
||||
coinbase = block.coinbase;
|
||||
@ -1029,7 +1029,7 @@ BOOST_AUTO_TEST_CASE(send_ether)
|
||||
{
|
||||
char const* sourceCode = R"(
|
||||
contract test {
|
||||
constructor() payable public {}
|
||||
constructor() payable {}
|
||||
function a(address payable addr, uint amount) public returns (uint ret) {
|
||||
addr.send(amount);
|
||||
return address(this).balance;
|
||||
@ -1049,7 +1049,7 @@ BOOST_AUTO_TEST_CASE(transfer_ether)
|
||||
{
|
||||
char const* sourceCode = R"(
|
||||
contract A {
|
||||
constructor() public payable {}
|
||||
constructor() payable {}
|
||||
function a(address payable addr, uint amount) public returns (uint) {
|
||||
addr.transfer(amount);
|
||||
return address(this).balance;
|
||||
@ -1205,7 +1205,7 @@ BOOST_AUTO_TEST_CASE(log_in_constructor)
|
||||
{
|
||||
char const* sourceCode = R"(
|
||||
contract test {
|
||||
constructor() public {
|
||||
constructor() {
|
||||
log1(bytes32(uint256(1)), bytes32(uint256(2)));
|
||||
}
|
||||
}
|
||||
@ -1224,7 +1224,7 @@ BOOST_AUTO_TEST_CASE(selfdestruct)
|
||||
{
|
||||
char const* sourceCode = R"(
|
||||
contract test {
|
||||
constructor() public payable {}
|
||||
constructor() payable {}
|
||||
function a(address payable receiver) public returns (uint ret) {
|
||||
selfdestruct(receiver);
|
||||
return 10;
|
||||
@ -1613,7 +1613,7 @@ BOOST_AUTO_TEST_CASE(constructor_with_long_arguments)
|
||||
string public a;
|
||||
string public b;
|
||||
|
||||
constructor(string memory _a, string memory _b) public {
|
||||
constructor(string memory _a, string memory _b) {
|
||||
a = _a;
|
||||
b = _b;
|
||||
}
|
||||
@ -1642,7 +1642,7 @@ BOOST_AUTO_TEST_CASE(contracts_as_addresses)
|
||||
}
|
||||
contract test {
|
||||
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) {
|
||||
myBalance = address(this).balance;
|
||||
helperBalance = address(h).balance;
|
||||
@ -1719,8 +1719,8 @@ BOOST_AUTO_TEST_CASE(blockhash)
|
||||
BOOST_AUTO_TEST_CASE(internal_constructor)
|
||||
{
|
||||
char const* sourceCode = R"(
|
||||
contract C {
|
||||
constructor() internal {}
|
||||
abstract contract C {
|
||||
constructor() {}
|
||||
}
|
||||
)";
|
||||
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; }
|
||||
}
|
||||
contract sender {
|
||||
constructor() public payable {}
|
||||
constructor() payable {}
|
||||
function doSend(address rec) public returns (uint d)
|
||||
{
|
||||
bytes4 signature = bytes4(bytes32(keccak256("recv(uint256)")));
|
||||
@ -2401,14 +2401,14 @@ BOOST_AUTO_TEST_CASE(generic_delegatecall)
|
||||
uint public received;
|
||||
address public sender;
|
||||
uint public value;
|
||||
constructor() public payable {}
|
||||
constructor() payable {}
|
||||
function recv(uint256 x) public payable { received = x; sender = msg.sender; value = msg.value; }
|
||||
}
|
||||
contract Sender {
|
||||
uint public received;
|
||||
address public sender;
|
||||
uint public value;
|
||||
constructor() public payable {}
|
||||
constructor() payable {}
|
||||
function doSend(address rec) public payable
|
||||
{
|
||||
bytes4 signature = bytes4(bytes32(keccak256("recv(uint256)")));
|
||||
@ -2449,7 +2449,7 @@ BOOST_AUTO_TEST_CASE(generic_staticcall)
|
||||
char const* sourceCode = R"**(
|
||||
contract A {
|
||||
uint public x;
|
||||
constructor() public { x = 42; }
|
||||
constructor() { x = 42; }
|
||||
function pureFunction(uint256 p) public pure returns (uint256) { return p; }
|
||||
function viewFunction(uint256 p) public view returns (uint256) { return p + 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; }
|
||||
}
|
||||
contract sender {
|
||||
constructor() public { rec = new receiver(); }
|
||||
constructor() { rec = new receiver(); }
|
||||
fallback() external { savedData = msg.data; }
|
||||
function forward() public returns (bool) { address(rec).call(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 {
|
||||
receiver rec;
|
||||
constructor() public { rec = new receiver(); }
|
||||
constructor() { rec = new receiver(); }
|
||||
function viaCalldata() public returns (uint) {
|
||||
(bool success,) = address(rec).call(msg.data);
|
||||
require(success);
|
||||
@ -2657,7 +2657,7 @@ BOOST_AUTO_TEST_CASE(copying_bytes_multiassign)
|
||||
fallback() external { received = 0x80; }
|
||||
}
|
||||
contract sender {
|
||||
constructor() public { rec = new receiver(); }
|
||||
constructor() { rec = new receiver(); }
|
||||
fallback() external { savedData1 = savedData2 = msg.data; }
|
||||
function forward(bool selector) public returns (bool) {
|
||||
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 {
|
||||
uint public test = 1;
|
||||
uint[3] arr;
|
||||
constructor() public
|
||||
constructor()
|
||||
{
|
||||
uint index = 5;
|
||||
test = arr[index];
|
||||
@ -3631,7 +3631,7 @@ BOOST_AUTO_TEST_CASE(failing_send)
|
||||
}
|
||||
}
|
||||
contract Main {
|
||||
constructor() public payable {}
|
||||
constructor() payable {}
|
||||
function callHelper(address payable _a) public returns (bool r, uint bal) {
|
||||
r = !_a.send(5);
|
||||
bal = address(this).balance;
|
||||
@ -3856,7 +3856,7 @@ BOOST_AUTO_TEST_CASE(bytes_in_constructors_unpacker)
|
||||
contract Test {
|
||||
uint public m_x;
|
||||
bytes public m_s;
|
||||
constructor(uint x, bytes memory s) public {
|
||||
constructor(uint x, bytes memory s) {
|
||||
m_x = x;
|
||||
m_s = s;
|
||||
}
|
||||
@ -3877,7 +3877,7 @@ BOOST_AUTO_TEST_CASE(bytes_in_constructors_packer)
|
||||
contract Base {
|
||||
uint public m_x;
|
||||
bytes m_s;
|
||||
constructor(uint x, bytes memory s) public {
|
||||
constructor(uint x, bytes memory s) {
|
||||
m_x = x;
|
||||
m_s = s;
|
||||
}
|
||||
@ -3886,7 +3886,7 @@ BOOST_AUTO_TEST_CASE(bytes_in_constructors_packer)
|
||||
}
|
||||
}
|
||||
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) {
|
||||
return s;
|
||||
}
|
||||
@ -3916,7 +3916,7 @@ BOOST_AUTO_TEST_CASE(arrays_in_constructors)
|
||||
contract Base {
|
||||
uint public m_x;
|
||||
address[] m_s;
|
||||
constructor(uint x, address[] memory s) public {
|
||||
constructor(uint x, address[] memory s) {
|
||||
m_x = x;
|
||||
m_s = s;
|
||||
}
|
||||
@ -3925,7 +3925,7 @@ BOOST_AUTO_TEST_CASE(arrays_in_constructors)
|
||||
}
|
||||
}
|
||||
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) {
|
||||
return s;
|
||||
}
|
||||
@ -4468,7 +4468,7 @@ BOOST_AUTO_TEST_CASE(constant_string_literal)
|
||||
bytes32 constant public b = "abcdefghijklmnopq";
|
||||
string constant public x = "abefghijklmnopqabcdefghijklmnopqabcdefghijklmnopqabca";
|
||||
|
||||
constructor() public {
|
||||
constructor() {
|
||||
string memory xx = x;
|
||||
bytes32 bb = b;
|
||||
}
|
||||
@ -4969,7 +4969,7 @@ BOOST_AUTO_TEST_CASE(calldata_offset)
|
||||
{
|
||||
address[] _arr;
|
||||
string public last = "nd";
|
||||
constructor(address[] memory guardians) public
|
||||
constructor(address[] memory guardians)
|
||||
{
|
||||
_arr = guardians;
|
||||
}
|
||||
@ -4984,7 +4984,7 @@ BOOST_AUTO_TEST_CASE(reject_ether_sent_to_library)
|
||||
char const* sourceCode = R"(
|
||||
library lib {}
|
||||
contract c {
|
||||
constructor() public payable {}
|
||||
constructor() payable {}
|
||||
function f(address payable x) public returns (bool) {
|
||||
return x.send(1);
|
||||
}
|
||||
@ -5203,10 +5203,10 @@ BOOST_AUTO_TEST_CASE(index_access_with_type_conversion)
|
||||
BOOST_AUTO_TEST_CASE(failed_create)
|
||||
{
|
||||
char const* sourceCode = R"(
|
||||
contract D { constructor() public payable {} }
|
||||
contract D { constructor() payable {} }
|
||||
contract C {
|
||||
uint public x;
|
||||
constructor() public payable {}
|
||||
constructor() payable {}
|
||||
function f(uint amount) public returns (D) {
|
||||
x++;
|
||||
return (new D){value: amount}();
|
||||
@ -5235,7 +5235,7 @@ BOOST_AUTO_TEST_CASE(correctly_initialize_memory_array_in_constructor)
|
||||
char const* sourceCode = R"(
|
||||
contract C {
|
||||
bool public success;
|
||||
constructor() public {
|
||||
constructor() {
|
||||
// Make memory dirty.
|
||||
assembly {
|
||||
for { let i := 0 } lt(i, 64) { i := add(i, 1) } {
|
||||
@ -5272,7 +5272,7 @@ BOOST_AUTO_TEST_CASE(mutex)
|
||||
}
|
||||
contract Fund is mutexed {
|
||||
uint shares;
|
||||
constructor() public payable { shares = msg.value; }
|
||||
constructor() payable { shares = msg.value; }
|
||||
function withdraw(uint amount) public protected returns (uint) {
|
||||
// NOTE: It is very bad practice to write this function this way.
|
||||
// Please refer to the documentation of how to do this properly.
|
||||
@ -5297,7 +5297,7 @@ BOOST_AUTO_TEST_CASE(mutex)
|
||||
uint callDepth;
|
||||
bool protected;
|
||||
function setProtected(bool _protected) public { protected = _protected; }
|
||||
constructor(Fund _fund) public { fund = _fund; }
|
||||
constructor(Fund _fund) { fund = _fund; }
|
||||
function attack() public returns (uint) {
|
||||
callDepth = 0;
|
||||
return attackInternal();
|
||||
@ -5537,7 +5537,7 @@ BOOST_AUTO_TEST_CASE(include_creation_bytecode_only_once)
|
||||
contract D {
|
||||
bytes a = hex"1237651237125387136581271652831736512837126583171583712358126123765123712538713658127165283173651283712658317158371235812612376512371253871365812716528317365128371265831715837123581261237651237125387136581271652831736512837126583171583712358126";
|
||||
bytes b = hex"1237651237125327136581271252831736512837126583171383712358126123765125712538713658127165253173651283712658357158371235812612376512371a5387136581271652a317365128371265a317158371235812612a765123712538a13658127165a83173651283712a58317158371235a126";
|
||||
constructor(uint) public {}
|
||||
constructor(uint) {}
|
||||
}
|
||||
contract Double {
|
||||
function f() public {
|
||||
@ -5783,7 +5783,7 @@ BOOST_AUTO_TEST_CASE(bubble_up_error_messages_through_create)
|
||||
{
|
||||
char const* sourceCode = R"(
|
||||
contract E {
|
||||
constructor() public {
|
||||
constructor() {
|
||||
revert("message");
|
||||
}
|
||||
}
|
||||
@ -5897,7 +5897,7 @@ BOOST_AUTO_TEST_CASE(bare_call_return_data)
|
||||
{
|
||||
string sourceCode = R"DELIMITER(
|
||||
contract A {
|
||||
constructor() public {
|
||||
constructor() {
|
||||
}
|
||||
function return_bool() public pure returns(bool) {
|
||||
return true;
|
||||
@ -5928,7 +5928,7 @@ BOOST_AUTO_TEST_CASE(bare_call_return_data)
|
||||
}
|
||||
contract C {
|
||||
A addr;
|
||||
constructor() public {
|
||||
constructor() {
|
||||
addr = new A();
|
||||
}
|
||||
function f(string memory signature) public returns (bool, bytes memory) {
|
||||
@ -6259,7 +6259,7 @@ BOOST_AUTO_TEST_CASE(abi_encodePackedV2_structs)
|
||||
}
|
||||
S s;
|
||||
event E(S indexed);
|
||||
constructor() public {
|
||||
constructor() {
|
||||
s.a = 0x12;
|
||||
s.b = -7;
|
||||
s.c[0] = 2;
|
||||
@ -6324,7 +6324,7 @@ BOOST_AUTO_TEST_CASE(abi_encodePackedV2_arrayOfStrings)
|
||||
contract C {
|
||||
string[] x;
|
||||
event E(string[] indexed);
|
||||
constructor() public {
|
||||
constructor() {
|
||||
x.push("abc");
|
||||
x.push("0123456789012345678901234567890123456789");
|
||||
}
|
||||
@ -6367,7 +6367,7 @@ BOOST_AUTO_TEST_CASE(event_signature_in_library)
|
||||
}
|
||||
}
|
||||
contract C {
|
||||
constructor() public {
|
||||
constructor() {
|
||||
L.f();
|
||||
}
|
||||
}
|
||||
@ -6695,7 +6695,7 @@ BOOST_AUTO_TEST_CASE(dirty_scratch_space_prior_to_constant_optimiser)
|
||||
char const* sourceCode = R"(
|
||||
contract C {
|
||||
event X(uint);
|
||||
constructor() public {
|
||||
constructor() {
|
||||
assembly {
|
||||
// make scratch space dirty
|
||||
mstore(0, 0x4242424242424242424242424242424242424242424242424242424242424242)
|
||||
|
@ -97,7 +97,7 @@ BOOST_AUTO_TEST_CASE(implement_abstract_via_constructor)
|
||||
SourceUnit const* sourceUnit = nullptr;
|
||||
char const* text = R"(
|
||||
abstract contract base { function foo() public virtual; }
|
||||
abstract contract foo is base { constructor() public {} }
|
||||
abstract contract foo is base { constructor() {} }
|
||||
)";
|
||||
sourceUnit = parseAndAnalyse(text);
|
||||
std::vector<ASTPointer<ASTNode>> nodes = sourceUnit->nodes();
|
||||
|
@ -1070,7 +1070,7 @@ BOOST_AUTO_TEST_CASE(user_constructor)
|
||||
char const* sourceCode = R"(
|
||||
contract test {
|
||||
/// @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"(
|
||||
contract test {
|
||||
/// @notice this is a really nice constructor
|
||||
constructor(uint a, uint second) public { }
|
||||
constructor(uint a, uint second) { }
|
||||
/// another multiplier
|
||||
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
|
||||
/// @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
|
||||
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 second the second parameter is not very useful, it just provides additional confusion
|
||||
/// @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
|
||||
/// @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
|
||||
constructor(uint a, uint second) public { }
|
||||
constructor(uint a, uint second) { }
|
||||
/// @dev Multiplies a number by 7 and adds second parameter
|
||||
/// @param a Documentation for the first parameter starts here.
|
||||
/// Since it's a really complicated parameter we need 2 lines
|
||||
|
@ -378,7 +378,7 @@ BOOST_AUTO_TEST_CASE(computing_constants)
|
||||
uint m_b;
|
||||
uint m_c;
|
||||
uint m_d;
|
||||
constructor() public {
|
||||
constructor() {
|
||||
set();
|
||||
}
|
||||
function set() public returns (uint) {
|
||||
@ -562,7 +562,7 @@ BOOST_AUTO_TEST_CASE(dead_code_elimination_across_assemblies)
|
||||
char const* sourceCode = R"(
|
||||
contract DCE {
|
||||
function () internal returns (uint) stored;
|
||||
constructor() public {
|
||||
constructor() {
|
||||
stored = f;
|
||||
}
|
||||
function f() internal returns (uint) { return 7; }
|
||||
|
@ -1,7 +1,7 @@
|
||||
pragma solidity >=0.0.0;
|
||||
|
||||
contract Error1 {
|
||||
constructor() public {
|
||||
constructor() {
|
||||
balances[tx.origin] = ; // missing RHS.
|
||||
}
|
||||
|
||||
@ -16,5 +16,5 @@ contract Error1 {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// ParserError 6933: (95-96): Expected primary expression.
|
||||
// Warning 3347: (95-96): Recovered in Statement at ';'.
|
||||
// ParserError 6933: (88-89): Expected primary expression.
|
||||
// Warning 3347: (88-89): Recovered in Statement at ';'.
|
||||
|
@ -1,11 +1,11 @@
|
||||
pragma solidity >=0.0.0;
|
||||
|
||||
contract Error3 {
|
||||
constructor() public {
|
||||
constructor() {
|
||||
balances[tx.origin] = ; // missing RHS.
|
||||
}
|
||||
|
||||
}
|
||||
// ----
|
||||
// ParserError 6933: (95-96): Expected primary expression.
|
||||
// Warning 3347: (95-96): Recovered in Statement at ';'.
|
||||
// ParserError 6933: (88-89): Expected primary expression.
|
||||
// Warning 3347: (88-89): Recovered in Statement at ';'.
|
||||
|
@ -6,7 +6,7 @@
|
||||
pragma solidity >=0.0.0;
|
||||
|
||||
contract Error4 {
|
||||
constructor() public {
|
||||
constructor() {
|
||||
balances[tx.origin] = 1 2; // missing operator
|
||||
}
|
||||
|
||||
@ -21,9 +21,9 @@ contract Error4 {
|
||||
|
||||
}
|
||||
// ----
|
||||
// ParserError 6635: (249-250): Expected ';' but got 'Number'
|
||||
// ParserError 6635: (471-479): Expected ';' but got identifier
|
||||
// ParserError 6635: (529-533): Expected ';' but got 'emit'
|
||||
// ParserError 6635: (577-583): Expected ',' but got 'return'
|
||||
// ParserError 6933: (577-583): Expected primary expression.
|
||||
// Warning 3796: (588-589): Recovered in Statement at ';'.
|
||||
// ParserError 6635: (242-243): Expected ';' but got 'Number'
|
||||
// ParserError 6635: (464-472): Expected ';' but got identifier
|
||||
// ParserError 6635: (522-526): Expected ';' but got 'emit'
|
||||
// ParserError 6635: (570-576): Expected ',' but got 'return'
|
||||
// ParserError 6933: (570-576): Expected primary expression.
|
||||
// Warning 3796: (581-582): Recovered in Statement at ';'.
|
||||
|
@ -2,7 +2,7 @@ contract C {
|
||||
uint256 constant LEN = 3;
|
||||
uint256[LEN] public a;
|
||||
|
||||
constructor(uint256[LEN] memory _a) public {
|
||||
constructor(uint256[LEN] memory _a) {
|
||||
a = _a;
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ contract Creator {
|
||||
uint256 public r;
|
||||
address public ch;
|
||||
|
||||
constructor(address[3] memory s, uint256 x) public {
|
||||
constructor(address[3] memory s, uint256 x) {
|
||||
r = x;
|
||||
ch = s[2];
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
contract Helper {
|
||||
uint256 public flag;
|
||||
|
||||
constructor(uint256 x) public {
|
||||
constructor(uint256 x) {
|
||||
flag = x;
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ contract Sample {
|
||||
}
|
||||
s[2] public p;
|
||||
|
||||
constructor() public {
|
||||
constructor() {
|
||||
s memory m;
|
||||
m.x = 0xbbbb;
|
||||
m.y = 0xcccc;
|
||||
|
@ -8,7 +8,7 @@ contract buggystruct {
|
||||
string last;
|
||||
}
|
||||
|
||||
constructor() public {
|
||||
constructor() {
|
||||
bug = Buggy(10, 20, 30, "asdfghjkl");
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
contract C {
|
||||
function(bytes calldata) returns (byte) x;
|
||||
constructor() public { x = f; }
|
||||
constructor() { x = f; }
|
||||
function f(bytes calldata b) internal pure returns (byte) {
|
||||
return b[2];
|
||||
}
|
||||
|
@ -1,14 +1,14 @@
|
||||
contract BaseBase {
|
||||
uint256 m_a;
|
||||
|
||||
constructor(uint256 a) public {
|
||||
constructor(uint256 a) {
|
||||
m_a = a;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
contract Base is BaseBase(7) {
|
||||
constructor() public {
|
||||
constructor() {
|
||||
m_a *= m_a;
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,12 @@
|
||||
contract A1 { constructor() public {} }
|
||||
contract A1 { constructor() {} }
|
||||
contract B1 is A1 {}
|
||||
|
||||
contract A2 { constructor() public payable {} }
|
||||
contract A2 { constructor() payable {} }
|
||||
contract B2 is A2 {}
|
||||
|
||||
contract B3 {}
|
||||
|
||||
contract B4 { constructor() public {} }
|
||||
contract B4 { constructor() {} }
|
||||
|
||||
contract C {
|
||||
function createWithValue(bytes memory c, uint256 value) public payable returns (bool) {
|
||||
|
@ -2,7 +2,7 @@ contract Main {
|
||||
bytes3 name;
|
||||
bool flag;
|
||||
|
||||
constructor(bytes3 x, bool f) public {
|
||||
constructor(bytes3 x, bool f) {
|
||||
name = x;
|
||||
flag = f;
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ contract Helper {
|
||||
bytes3 name;
|
||||
bool flag;
|
||||
|
||||
constructor(bytes3 x, bool f) public {
|
||||
constructor(bytes3 x, bool f) {
|
||||
name = x;
|
||||
flag = f;
|
||||
}
|
||||
@ -20,7 +20,7 @@ contract Helper {
|
||||
contract Main {
|
||||
Helper h;
|
||||
|
||||
constructor() public {
|
||||
constructor() {
|
||||
h = new Helper("abc", true);
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@ contract C {
|
||||
uint256 public a;
|
||||
uint256[3] public b;
|
||||
|
||||
constructor(uint256 _a, uint256[3] memory _b) public {
|
||||
constructor(uint256 _a, uint256[3] memory _b) {
|
||||
a = _a;
|
||||
b = _b;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
contract A {
|
||||
constructor() public {
|
||||
constructor() {
|
||||
address(this).call("123");
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
contract BaseBase {
|
||||
uint256 m_a;
|
||||
|
||||
constructor(uint256 a) public {
|
||||
constructor(uint256 a) {
|
||||
m_a = a;
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@ contract Test {
|
||||
bytes3 name;
|
||||
bool flag;
|
||||
|
||||
constructor() public {
|
||||
constructor() {
|
||||
setName("abc");
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
contract Test {
|
||||
bytes6 name;
|
||||
|
||||
constructor() public {
|
||||
constructor() {
|
||||
function (bytes6 _name) internal setter = setName;
|
||||
setter("abcdef");
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
contract A1 {}
|
||||
contract B1 is A1 { constructor() public payable {} }
|
||||
contract B1 is A1 { constructor() payable {} }
|
||||
|
||||
contract A2 { constructor() public {} }
|
||||
contract B2 is A2 { constructor() public payable {} }
|
||||
contract A2 { constructor() {} }
|
||||
contract B2 is A2 { constructor() payable {} }
|
||||
|
||||
contract B3 { constructor() public payable {} }
|
||||
contract B3 { constructor() payable {} }
|
||||
|
||||
contract C {
|
||||
function f() public payable returns (bool) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
contract C {
|
||||
constructor() public payable {}
|
||||
constructor() payable {}
|
||||
}
|
||||
|
||||
// ====
|
||||
|
@ -2,7 +2,7 @@ contract C {
|
||||
uint256 public result_in_constructor;
|
||||
function(uint256) returns (uint256) internal x;
|
||||
|
||||
constructor() public {
|
||||
constructor() {
|
||||
x = double;
|
||||
result_in_constructor = use(2);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
contract C {
|
||||
function() returns (uint256) internal x;
|
||||
|
||||
constructor() public {
|
||||
constructor() {
|
||||
x = unused;
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@ library L {
|
||||
contract C {
|
||||
function() returns (uint256) internal x;
|
||||
|
||||
constructor() public {
|
||||
constructor() {
|
||||
x = L.x;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
contract A {
|
||||
uint x;
|
||||
constructor() public {
|
||||
constructor() {
|
||||
x = 42;
|
||||
}
|
||||
function f() public returns(uint256) {
|
||||
|
@ -2,7 +2,7 @@ contract C {
|
||||
uint public i;
|
||||
uint public k;
|
||||
|
||||
constructor(uint newI, uint newK) public {
|
||||
constructor(uint newI, uint newK) {
|
||||
i = newI;
|
||||
k = newK;
|
||||
}
|
||||
|
@ -2,22 +2,22 @@ contract A {
|
||||
uint public i;
|
||||
uint public k;
|
||||
|
||||
constructor(uint newI, uint newK) public {
|
||||
constructor(uint newI, uint newK) {
|
||||
i = newI;
|
||||
k = newK;
|
||||
}
|
||||
}
|
||||
abstract contract B is A {
|
||||
uint public j;
|
||||
constructor(uint newJ) public {
|
||||
constructor(uint newJ) {
|
||||
j = newJ;
|
||||
}
|
||||
}
|
||||
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 {
|
||||
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
|
||||
|
@ -2,13 +2,13 @@ contract C {
|
||||
uint public i;
|
||||
uint public k;
|
||||
|
||||
constructor(uint newI, uint newK) public {
|
||||
constructor(uint newI, uint newK) {
|
||||
i = newI;
|
||||
k = newK;
|
||||
}
|
||||
}
|
||||
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
|
||||
|
@ -2,7 +2,7 @@ contract C {
|
||||
uint public i;
|
||||
uint public k;
|
||||
|
||||
constructor(uint newI, uint newK) public {
|
||||
constructor(uint newI, uint newK) {
|
||||
i = newI;
|
||||
k = newK;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
contract test {
|
||||
enum ActionChoices {GoLeft, GoRight, GoStraight}
|
||||
|
||||
constructor() public {}
|
||||
constructor() {}
|
||||
|
||||
function getChoiceExp(uint256 x) public returns (uint256 d) {
|
||||
choice = ActionChoices(x);
|
||||
|
@ -1,7 +1,7 @@
|
||||
contract test {
|
||||
enum ActionChoices {GoLeft, GoRight, GoStraight, Sit}
|
||||
|
||||
constructor() public {
|
||||
constructor() {
|
||||
choices = ActionChoices.GoStraight;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
contract C {
|
||||
uint public i;
|
||||
constructor() public {
|
||||
constructor() {
|
||||
i = 2;
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,12 @@
|
||||
contract C {
|
||||
uint public i;
|
||||
constructor(uint newI) public {
|
||||
constructor(uint newI) {
|
||||
i = newI;
|
||||
}
|
||||
}
|
||||
contract D {
|
||||
C c;
|
||||
constructor(uint v) public {
|
||||
constructor(uint v) {
|
||||
c = new C(v);
|
||||
}
|
||||
function f() public returns (uint r) {
|
||||
|
@ -1,12 +1,12 @@
|
||||
contract C {
|
||||
uint public i;
|
||||
constructor(uint newI) public {
|
||||
constructor(uint newI) {
|
||||
i = newI;
|
||||
}
|
||||
}
|
||||
contract D {
|
||||
C c;
|
||||
constructor(uint v) public {
|
||||
constructor(uint v) {
|
||||
c = new C{salt: "abc"}(v);
|
||||
}
|
||||
function f() public returns (uint r) {
|
||||
|
@ -18,7 +18,7 @@ contract helper {
|
||||
contract test {
|
||||
helper h;
|
||||
|
||||
constructor() public payable {
|
||||
constructor() payable {
|
||||
h = new helper();
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,7 @@ contract helper {
|
||||
}
|
||||
contract test {
|
||||
helper h;
|
||||
constructor() public payable {
|
||||
constructor() payable {
|
||||
h = new helper();
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@ contract test {
|
||||
bytes6 public name;
|
||||
bytes32 public a_hash;
|
||||
address public an_address;
|
||||
constructor() public {
|
||||
constructor() {
|
||||
data = 8;
|
||||
name = "Celina";
|
||||
a_hash = keccak256("\x7b");
|
||||
|
@ -6,7 +6,7 @@ contract Receiver {
|
||||
|
||||
|
||||
contract Main {
|
||||
constructor() public payable {}
|
||||
constructor() payable {}
|
||||
|
||||
function s() public returns (bool) {
|
||||
Receiver r = new Receiver();
|
||||
|
@ -15,7 +15,7 @@ contract Flow {
|
||||
success = true;
|
||||
}
|
||||
|
||||
constructor() public {
|
||||
constructor() {
|
||||
stages[msg.sender] = stage0;
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
contract C {
|
||||
uint256 public initial;
|
||||
|
||||
constructor() public {
|
||||
constructor() {
|
||||
initial = double(2);
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
contract C {
|
||||
function(uint256) returns (uint256) internal x;
|
||||
|
||||
constructor() public {
|
||||
constructor() {
|
||||
x = double;
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,7 @@ contract C {
|
||||
}
|
||||
mapping(uint256 => Y)[] public m;
|
||||
mapping(uint256 => Y)[3] public n;
|
||||
constructor() public {
|
||||
constructor() {
|
||||
m.push();
|
||||
m.push();
|
||||
m[1][0].a = 1;
|
||||
|
@ -1,6 +1,6 @@
|
||||
contract C {
|
||||
uint8[][2] public a;
|
||||
constructor() public {
|
||||
constructor() {
|
||||
a[1].push(3);
|
||||
a[1].push(4);
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
contract C {
|
||||
mapping(uint => mapping(uint => uint)) public x;
|
||||
constructor() public {
|
||||
constructor() {
|
||||
x[1][2] = 3;
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ contract C {
|
||||
}
|
||||
mapping(uint256 => Y[]) public m;
|
||||
mapping(uint256 => Y[3]) public n;
|
||||
constructor() public {
|
||||
constructor() {
|
||||
m[1].push().a = 1;
|
||||
m[1][0].b = 2;
|
||||
m[1].push().a = 3;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user