Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Aniket-Engg committed Oct 10, 2018
1 parent a46e176 commit 1d86e28
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 30 deletions.
6 changes: 5 additions & 1 deletion contracts/crowdsale/distribution/FinalizableCrowdsale.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ import "../validation/TimedCrowdsale.sol";
contract FinalizableCrowdsale is TimedCrowdsale {
using SafeMath for uint256;

bool private _finalized = false;
bool private _finalized;

event CrowdsaleFinalized();

constructor() public {
_finalized = false;
}

/**
* @return true if the crowdsale is finalized, false otherwise.
*/
Expand Down
6 changes: 5 additions & 1 deletion contracts/lifecycle/Pausable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ contract Pausable is PauserRole {
event Paused();
event Unpaused();

bool private _paused = false;
bool private _paused;

constructor() public {
_paused = false;
}

/**
* @return true if the contract is paused, false otherwise.
Expand Down
6 changes: 4 additions & 2 deletions contracts/payment/SplitPayment.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import "../math/SafeMath.sol";
contract SplitPayment {
using SafeMath for uint256;

uint256 private _totalShares = 0;
uint256 private _totalReleased = 0;
uint256 private _totalShares;
uint256 private _totalReleased;

mapping(address => uint256) private _shares;
mapping(address => uint256) private _released;
Expand All @@ -24,6 +24,8 @@ contract SplitPayment {
require(payees.length == shares.length);
require(payees.length > 0);

_totalShares = 0;
_totalReleased = 0;
for (uint256 i = 0; i < payees.length; i++) {
_addPayee(payees[i], shares[i]);
}
Expand Down
6 changes: 5 additions & 1 deletion contracts/utils/ReentrancyGuard.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ pragma solidity ^0.4.24;
contract ReentrancyGuard {

/// @dev counter to allow mutex lock with only one SSTORE operation
uint256 private _guardCounter = 1;
uint256 private _guardCounter;

constructor() public {
_guardCounter = 1;
}

/**
* @dev Prevents a contract from calling itself, directly or indirectly.
Expand Down
2 changes: 1 addition & 1 deletion test/crowdsale/AllowanceCrowdsale.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ contract('AllowanceCrowdsale', function ([_, investor, wallet, purchaser, tokenW
purchaser: investor,
beneficiary: investor,
value: value,
amount: expectedTokenAmount
amount: expectedTokenAmount,
});
});

Expand Down
4 changes: 2 additions & 2 deletions test/crowdsale/Crowdsale.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ contract('Crowdsale', function ([_, investor, wallet, purchaser]) {
purchaser: investor,
beneficiary: investor,
value: value,
amount: expectedTokenAmount
amount: expectedTokenAmount,
});
});

Expand All @@ -111,7 +111,7 @@ contract('Crowdsale', function ([_, investor, wallet, purchaser]) {
purchaser: purchaser,
beneficiary: investor,
value: value,
amount: expectedTokenAmount
amount: expectedTokenAmount,
});
});

Expand Down
2 changes: 1 addition & 1 deletion test/crowdsale/MintedCrowdsale.behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function shouldBehaveLikeMintedCrowdsale ([_, investor, wallet, purchaser], rate
purchaser: investor,
beneficiary: investor,
value: value,
amount: expectedTokenAmount
amount: expectedTokenAmount,
});
});

Expand Down
4 changes: 2 additions & 2 deletions test/payment/Escrow.behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function shouldBehaveLikeEscrow (primary, [payee1, payee2]) {
const { logs } = await this.escrow.deposit(payee1, { from: primary, value: amount });
expectEvent.inLogs(logs, 'Deposited', {
payee: payee1,
weiAmount: amount
weiAmount: amount,
});
});

Expand Down Expand Up @@ -87,7 +87,7 @@ function shouldBehaveLikeEscrow (primary, [payee1, payee2]) {
const { logs } = await this.escrow.withdraw(payee1, { from: primary });
expectEvent.inLogs(logs, 'Withdrawn', {
payee: payee1,
weiAmount: amount
weiAmount: amount,
});
});
});
Expand Down
14 changes: 7 additions & 7 deletions test/token/ERC20/ERC20.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ contract('ERC20', function ([_, owner, recipient, anotherAccount]) {
expectEvent.inLogs(logs, 'Transfer', {
from: owner,
to: to,
value: amount
value: amount,
});
});
});
Expand Down Expand Up @@ -92,7 +92,7 @@ contract('ERC20', function ([_, owner, recipient, anotherAccount]) {
expectEvent.inLogs(logs, 'Approval', {
owner: owner,
spender: spender,
value: amount
value: amount,
});
});

Expand Down Expand Up @@ -126,7 +126,7 @@ contract('ERC20', function ([_, owner, recipient, anotherAccount]) {
expectEvent.inLogs(logs, 'Approval', {
owner: owner,
spender: spender,
value: amount
value: amount,
});
});

Expand Down Expand Up @@ -196,7 +196,7 @@ contract('ERC20', function ([_, owner, recipient, anotherAccount]) {
expectEvent.inLogs(logs, 'Transfer', {
from: owner,
to: to,
value: amount
value: amount,
});
});
});
Expand Down Expand Up @@ -271,7 +271,7 @@ contract('ERC20', function ([_, owner, recipient, anotherAccount]) {
expectEvent.inLogs(logs, 'Approval', {
owner: owner,
spender: spender,
value: 0
value: 0,
});
});

Expand Down Expand Up @@ -328,7 +328,7 @@ contract('ERC20', function ([_, owner, recipient, anotherAccount]) {
expectEvent.inLogs(logs, 'Approval', {
owner: owner,
spender: spender,
value: amount
value: amount,
});
});

Expand Down Expand Up @@ -362,7 +362,7 @@ contract('ERC20', function ([_, owner, recipient, anotherAccount]) {
expectEvent.inLogs(logs, 'Approval', {
owner: owner,
spender: spender,
value: amount
value: amount,
});
});

Expand Down
4 changes: 2 additions & 2 deletions test/token/ERC20/behaviors/ERC20Burnable.behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function shouldBehaveLikeERC20Burnable (owner, initialBalance, [burner]) {
expectEvent.inLogs(this.logs, 'Transfer', {
from: owner,
to: ZERO_ADDRESS,
value: amount
value: amount,
});
});
}
Expand Down Expand Up @@ -78,7 +78,7 @@ function shouldBehaveLikeERC20Burnable (owner, initialBalance, [burner]) {
expectEvent.inLogs(this.logs, 'Transfer', {
from: owner,
to: ZERO_ADDRESS,
value: amount
value: amount,
});
});
}
Expand Down
2 changes: 1 addition & 1 deletion test/token/ERC20/behaviors/ERC20Mintable.behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function shouldBehaveLikeERC20Mintable (minter, [anyone]) {
expectEvent.inLogs(this.logs, 'Transfer', {
from: ZERO_ADDRESS,
to: anyone,
value: amount
value: amount,
});
});
}
Expand Down
14 changes: 7 additions & 7 deletions test/token/ERC721/ERC721.behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,15 @@ function shouldBehaveLikeERC721 (
expectEvent.inLogs(logs, 'Transfer', {
from: owner,
to: this.toWhom,
tokenId: tokenId
tokenId: tokenId,
});
});
} else {
it('emits only a transfer event', async function () {
expectEvent.inLogs(logs, 'Transfer', {
from: owner,
to: this.toWhom,
tokenId: tokenId
tokenId: tokenId,
});
});
}
Expand Down Expand Up @@ -165,7 +165,7 @@ function shouldBehaveLikeERC721 (
expectEvent.inLogs(logs, 'Transfer', {
from: owner,
to: owner,
tokenId: tokenId
tokenId: tokenId,
});
});

Expand Down Expand Up @@ -347,7 +347,7 @@ function shouldBehaveLikeERC721 (
expectEvent.inLogs(logs, 'Approval', {
owner: owner,
approved: address,
tokenId: tokenId
tokenId: tokenId,
});
});
};
Expand Down Expand Up @@ -457,7 +457,7 @@ function shouldBehaveLikeERC721 (
expectEvent.inLogs(logs, 'ApprovalForAll', {
owner: owner,
operator: operator,
approved: true
approved: true,
});
});
});
Expand All @@ -479,7 +479,7 @@ function shouldBehaveLikeERC721 (
expectEvent.inLogs(logs, 'ApprovalForAll', {
owner: owner,
operator: operator,
approved: true
approved: true,
});
});

Expand Down Expand Up @@ -507,7 +507,7 @@ function shouldBehaveLikeERC721 (
expectEvent.inLogs(logs, 'ApprovalForAll', {
owner: owner,
operator: operator,
approved: true
approved: true,
});
});
});
Expand Down
4 changes: 2 additions & 2 deletions test/token/ERC721/ERC721MintBurn.behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function shouldBehaveLikeMintAndBurnERC721 (
expectEvent.inLogs(logs, 'Transfer', {
from: ZERO_ADDRESS,
to: newOwner,
tokenId: thirdTokenId
tokenId: thirdTokenId,
});
});
});
Expand Down Expand Up @@ -90,7 +90,7 @@ function shouldBehaveLikeMintAndBurnERC721 (
expectEvent.inLogs(logs, 'Transfer', {
from: owner,
to: ZERO_ADDRESS,
tokenId: tokenId
tokenId: tokenId,
});
});
});
Expand Down

0 comments on commit 1d86e28

Please sign in to comment.