Skip to content

Commit da67e43

Browse files
Aniket-Enggnventuro
authored andcommitted
Non-constructor initialization removed (#1403)
* signing prefix added * Minor improvement * Tests changed * Successfully tested * Minor improvements * Minor improvements * Revert "Dangling commas are now required. (#1359)" This reverts commit a688977. * updates * fixes #1391
1 parent b0da0fd commit da67e43

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

contracts/crowdsale/distribution/FinalizableCrowdsale.sol

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@ import "../validation/TimedCrowdsale.sol";
1111
contract FinalizableCrowdsale is TimedCrowdsale {
1212
using SafeMath for uint256;
1313

14-
bool private _finalized = false;
14+
bool private _finalized;
1515

1616
event CrowdsaleFinalized();
1717

18+
constructor() public {
19+
_finalized = false;
20+
}
21+
1822
/**
1923
* @return true if the crowdsale is finalized, false otherwise.
2024
*/

contracts/lifecycle/Pausable.sol

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ contract Pausable is PauserRole {
1010
event Paused();
1111
event Unpaused();
1212

13-
bool private _paused = false;
13+
bool private _paused;
14+
15+
constructor() public {
16+
_paused = false;
17+
}
1418

1519
/**
1620
* @return true if the contract is paused, false otherwise.

contracts/payment/SplitPayment.sol

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import "../math/SafeMath.sol";
1010
contract SplitPayment {
1111
using SafeMath for uint256;
1212

13-
uint256 private _totalShares = 0;
14-
uint256 private _totalReleased = 0;
13+
uint256 private _totalShares;
14+
uint256 private _totalReleased;
1515

1616
mapping(address => uint256) private _shares;
1717
mapping(address => uint256) private _released;
@@ -24,6 +24,8 @@ contract SplitPayment {
2424
require(payees.length == shares.length);
2525
require(payees.length > 0);
2626

27+
_totalShares = 0;
28+
_totalReleased = 0;
2729
for (uint256 i = 0; i < payees.length; i++) {
2830
_addPayee(payees[i], shares[i]);
2931
}

contracts/utils/ReentrancyGuard.sol

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ pragma solidity ^0.4.24;
99
contract ReentrancyGuard {
1010

1111
/// @dev counter to allow mutex lock with only one SSTORE operation
12-
uint256 private _guardCounter = 1;
12+
uint256 private _guardCounter;
13+
14+
constructor() public {
15+
_guardCounter = 1;
16+
}
1317

1418
/**
1519
* @dev Prevents a contract from calling itself, directly or indirectly.

0 commit comments

Comments
 (0)