Commit 6d8bb497 by Roy Blankman

removing trailing whitespace

parent 1737555b
...@@ -6,4 +6,4 @@ build/ ...@@ -6,4 +6,4 @@ build/
/coverage /coverage
coverage.json coverage.json
allFiredEvents allFiredEvents
scTopics scTopics
\ No newline at end of file
...@@ -2,4 +2,4 @@ module.exports = { ...@@ -2,4 +2,4 @@ module.exports = {
norpc: true, norpc: true,
testCommand: 'node --max-old-space-size=4096 ../node_modules/.bin/truffle test --network coverage', testCommand: 'node --max-old-space-size=4096 ../node_modules/.bin/truffle test --network coverage',
skipFiles: ['lifecycle/Migrations.sol'] skipFiles: ['lifecycle/Migrations.sol']
} }
\ No newline at end of file
node_modules node_modules
\ No newline at end of file
...@@ -5,18 +5,18 @@ Copyright (c) 2016 Smart Contract Solutions, Inc. ...@@ -5,18 +5,18 @@ Copyright (c) 2016 Smart Contract Solutions, Inc.
Permission is hereby granted, free of charge, to any person obtaining Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including "Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish, without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to permit persons to whom the Software is furnished to do so, subject to
the following conditions: the following conditions:
The above copyright notice and this permission notice shall be included The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software. in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
...@@ -4,11 +4,11 @@ import '../token/MintableToken.sol'; ...@@ -4,11 +4,11 @@ import '../token/MintableToken.sol';
import '../math/SafeMath.sol'; import '../math/SafeMath.sol';
/** /**
* @title Crowdsale * @title Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale. * @dev Crowdsale is a base contract for managing a token crowdsale.
* Crowdsales have a start and end timestamps, where investors can make * Crowdsales have a start and end timestamps, where investors can make
* token purchases and the crowdsale will assign them tokens based * token purchases and the crowdsale will assign them tokens based
* on a token per ETH rate. Funds collected are forwarded to a wallet * on a token per ETH rate. Funds collected are forwarded to a wallet
* as they arrive. * as they arrive.
*/ */
contract Crowdsale { contract Crowdsale {
...@@ -36,7 +36,7 @@ contract Crowdsale { ...@@ -36,7 +36,7 @@ contract Crowdsale {
* @param beneficiary who got the tokens * @param beneficiary who got the tokens
* @param value weis paid for purchase * @param value weis paid for purchase
* @param amount amount of tokens purchased * @param amount amount of tokens purchased
*/ */
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount); event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
...@@ -53,7 +53,7 @@ contract Crowdsale { ...@@ -53,7 +53,7 @@ contract Crowdsale {
wallet = _wallet; wallet = _wallet;
} }
// creates the token to be sold. // creates the token to be sold.
// override this method to have crowdsale of a specific mintable token. // override this method to have crowdsale of a specific mintable token.
function createTokenContract() internal returns (MintableToken) { function createTokenContract() internal returns (MintableToken) {
return new MintableToken(); return new MintableToken();
......
...@@ -7,7 +7,7 @@ import './Crowdsale.sol'; ...@@ -7,7 +7,7 @@ import './Crowdsale.sol';
/** /**
* @title FinalizableCrowdsale * @title FinalizableCrowdsale
* @dev Extension of Crowsdale where an owner can do extra work * @dev Extension of Crowsdale where an owner can do extra work
* after finishing. * after finishing.
*/ */
contract FinalizableCrowdsale is Crowdsale, Ownable { contract FinalizableCrowdsale is Crowdsale, Ownable {
using SafeMath for uint256; using SafeMath for uint256;
...@@ -26,7 +26,7 @@ contract FinalizableCrowdsale is Crowdsale, Ownable { ...@@ -26,7 +26,7 @@ contract FinalizableCrowdsale is Crowdsale, Ownable {
finalization(); finalization();
Finalized(); Finalized();
isFinalized = true; isFinalized = true;
} }
......
...@@ -45,4 +45,4 @@ contract SampleCrowdsale is CappedCrowdsale, RefundableCrowdsale { ...@@ -45,4 +45,4 @@ contract SampleCrowdsale is CappedCrowdsale, RefundableCrowdsale {
return new SampleCrowdsaleToken(); return new SampleCrowdsaleToken();
} }
} }
\ No newline at end of file
...@@ -10,10 +10,10 @@ import "../ownership/Ownable.sol"; ...@@ -10,10 +10,10 @@ import "../ownership/Ownable.sol";
*/ */
contract Destructible is Ownable { contract Destructible is Ownable {
function Destructible() payable { } function Destructible() payable { }
/** /**
* @dev Transfers the current balance to the owner and terminates the contract. * @dev Transfers the current balance to the owner and terminates the contract.
*/ */
function destroy() onlyOwner { function destroy() onlyOwner {
selfdestruct(owner); selfdestruct(owner);
......
...@@ -4,7 +4,7 @@ pragma solidity ^0.4.11; ...@@ -4,7 +4,7 @@ pragma solidity ^0.4.11;
import "../ownership/Ownable.sol"; import "../ownership/Ownable.sol";
import "../token/ERC20Basic.sol"; import "../token/ERC20Basic.sol";
/** /**
* @title TokenDestructible: * @title TokenDestructible:
* @author Remco Bloemen <remco@2π.com> * @author Remco Bloemen <remco@2π.com>
* @dev Base contract that can be destroyed by owner. All funds in contract including * @dev Base contract that can be destroyed by owner. All funds in contract including
...@@ -12,9 +12,9 @@ import "../token/ERC20Basic.sol"; ...@@ -12,9 +12,9 @@ import "../token/ERC20Basic.sol";
*/ */
contract TokenDestructible is Ownable { contract TokenDestructible is Ownable {
function TokenDestructible() payable { } function TokenDestructible() payable { }
/** /**
* @notice Terminate contract and refund to owner * @notice Terminate contract and refund to owner
* @param tokens List of addresses of ERC20 or ERC20Basic token contracts to * @param tokens List of addresses of ERC20 or ERC20Basic token contracts to
refund. refund.
......
...@@ -4,7 +4,7 @@ import './Ownable.sol'; ...@@ -4,7 +4,7 @@ import './Ownable.sol';
/** /**
* @title Contactable token * @title Contactable token
* @dev Basic version of a contactable contract, allowing the owner to provide a string with their * @dev Basic version of a contactable contract, allowing the owner to provide a string with their
* contact information. * contact information.
*/ */
contract Contactable is Ownable{ contract Contactable is Ownable{
......
...@@ -2,7 +2,7 @@ pragma solidity ^0.4.11; ...@@ -2,7 +2,7 @@ pragma solidity ^0.4.11;
import "./Ownable.sol"; import "./Ownable.sol";
/** /**
* @title Contracts that should not own Contracts * @title Contracts that should not own Contracts
* @author Remco Bloemen <remco@2π.com> * @author Remco Bloemen <remco@2π.com>
* @dev Should contracts (anything Ownable) end up being owned by this contract, it allows the owner * @dev Should contracts (anything Ownable) end up being owned by this contract, it allows the owner
......
...@@ -4,10 +4,10 @@ import "./HasNoEther.sol"; ...@@ -4,10 +4,10 @@ import "./HasNoEther.sol";
import "./HasNoTokens.sol"; import "./HasNoTokens.sol";
import "./HasNoContracts.sol"; import "./HasNoContracts.sol";
/** /**
* @title Base contract for contracts that should not own things. * @title Base contract for contracts that should not own things.
* @author Remco Bloemen <remco@2π.com> * @author Remco Bloemen <remco@2π.com>
* @dev Solves a class of errors where a contract accidentally becomes owner of Ether, Tokens or * @dev Solves a class of errors where a contract accidentally becomes owner of Ether, Tokens or
* Owned contracts. See respective base contracts for details. * Owned contracts. See respective base contracts for details.
*/ */
contract NoOwner is HasNoEther, HasNoTokens, HasNoContracts { contract NoOwner is HasNoEther, HasNoTokens, HasNoContracts {
......
...@@ -36,7 +36,7 @@ contract Ownable { ...@@ -36,7 +36,7 @@ contract Ownable {
* @param newOwner The address to transfer ownership to. * @param newOwner The address to transfer ownership to.
*/ */
function transferOwnership(address newOwner) onlyOwner { function transferOwnership(address newOwner) onlyOwner {
require(newOwner != address(0)); require(newOwner != address(0));
OwnershipTransferred(owner, newOwner); OwnershipTransferred(owner, newOwner);
owner = newOwner; owner = newOwner;
} }
......
...@@ -7,7 +7,7 @@ import '../math/SafeMath.sol'; ...@@ -7,7 +7,7 @@ import '../math/SafeMath.sol';
/** /**
* @title Basic token * @title Basic token
* @dev Basic version of StandardToken, with no allowances. * @dev Basic version of StandardToken, with no allowances.
*/ */
contract BasicToken is ERC20Basic { contract BasicToken is ERC20Basic {
using SafeMath for uint256; using SafeMath for uint256;
...@@ -31,7 +31,7 @@ contract BasicToken is ERC20Basic { ...@@ -31,7 +31,7 @@ contract BasicToken is ERC20Basic {
/** /**
* @dev Gets the balance of the specified address. * @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of. * @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address. * @return An uint256 representing the amount owned by the passed address.
*/ */
function balanceOf(address _owner) constant returns (uint256 balance) { function balanceOf(address _owner) constant returns (uint256 balance) {
......
...@@ -65,21 +65,21 @@ contract StandardToken is ERC20, BasicToken { ...@@ -65,21 +65,21 @@ contract StandardToken is ERC20, BasicToken {
function allowance(address _owner, address _spender) constant returns (uint256 remaining) { function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
return allowed[_owner][_spender]; return allowed[_owner][_spender];
} }
/** /**
* approve should be called when allowed[_spender] == 0. To increment * approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until * allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined) * the first transaction is mined)
* From MonolithDAO Token.sol * From MonolithDAO Token.sol
*/ */
function increaseApproval (address _spender, uint _addedValue) function increaseApproval (address _spender, uint _addedValue)
returns (bool success) { returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]); Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true; return true;
} }
function decreaseApproval (address _spender, uint _subtractedValue) function decreaseApproval (address _spender, uint _subtractedValue)
returns (bool success) { returns (bool success) {
uint oldValue = allowed[msg.sender][_spender]; uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) { if (_subtractedValue > oldValue) {
......
...@@ -17,4 +17,4 @@ help: ...@@ -17,4 +17,4 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new # Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile %: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
\ No newline at end of file
...@@ -9,4 +9,4 @@ Returns the token balance of the passed address. ...@@ -9,4 +9,4 @@ Returns the token balance of the passed address.
function transfer(address _to, uint _value) returns (bool success) function transfer(address _to, uint _value) returns (bool success)
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Transfers tokens from sender's account. Amount must not be greater than sender's balance. Transfers tokens from sender's account. Amount must not be greater than sender's balance.
\ No newline at end of file
...@@ -9,4 +9,4 @@ Interested in contributing to Zeppelin? ...@@ -9,4 +9,4 @@ Interested in contributing to Zeppelin?
* Framework proposal and roadmap: https://medium.com/zeppelin-blog/zeppelin-framework-proposal-and-development-roadmap-fdfa9a3a32ab#.iain47pak * Framework proposal and roadmap: https://medium.com/zeppelin-blog/zeppelin-framework-proposal-and-development-roadmap-fdfa9a3a32ab#.iain47pak
* Issue tracker: https://github.com/OpenZeppelin/zeppelin-solidity/issues * Issue tracker: https://github.com/OpenZeppelin/zeppelin-solidity/issues
* Contribution guidelines: https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/CONTRIBUTING.md * Contribution guidelines: https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/CONTRIBUTING.md
\ No newline at end of file
...@@ -6,14 +6,14 @@ ...@@ -6,14 +6,14 @@
Welcome to Zeppelin-Solidity Welcome to Zeppelin-Solidity
============================================= =============================================
Zeppelin is a library for writing secure Smart Contracts on Ethereum. Zeppelin is a library for writing secure Smart Contracts on Ethereum.
With Zeppelin, you can build distributed applications, protocols and organizations: With Zeppelin, you can build distributed applications, protocols and organizations:
* using :doc:`contract-security-patterns` * using :doc:`contract-security-patterns`
* in the `Solidity language <https://solidity.readthedocs.io/en/develop/>`_. * in the `Solidity language <https://solidity.readthedocs.io/en/develop/>`_.
The code is open-source, and `available on github <https://github.com/OpenZeppelin/zeppelin-solidity>`_. The code is open-source, and `available on github <https://github.com/OpenZeppelin/zeppelin-solidity>`_.
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
...@@ -24,7 +24,7 @@ The code is open-source, and `available on github <https://github.com/OpenZeppel ...@@ -24,7 +24,7 @@ The code is open-source, and `available on github <https://github.com/OpenZeppel
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
:caption: Smart Contracts :caption: Smart Contracts
ownable ownable
Pausable Pausable
destructible destructible
...@@ -41,7 +41,7 @@ The code is open-source, and `available on github <https://github.com/OpenZeppel ...@@ -41,7 +41,7 @@ The code is open-source, and `available on github <https://github.com/OpenZeppel
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
:caption: Developer Resources :caption: Developer Resources
contract-security-patterns contract-security-patterns
developer-resources developer-resources
license license
\ No newline at end of file
...@@ -13,4 +13,4 @@ Destroys the contract and sends funds back to the owner. ...@@ -13,4 +13,4 @@ Destroys the contract and sends funds back to the owner.
destroyAndSend(address _recipient) onlyOwner destroyAndSend(address _recipient) onlyOwner
""""""""""""""""""" """""""""""""""""""
Destroys the contract and sends funds back to the _recepient. Destroys the contract and sends funds back to the _recepient.
\ No newline at end of file
...@@ -6,18 +6,18 @@ Copyright (c) 2016 Smart Contract Solutions, Inc. ...@@ -6,18 +6,18 @@ Copyright (c) 2016 Smart Contract Solutions, Inc.
Permission is hereby granted, free of charge, to any person obtaining Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including "Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish, without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to permit persons to whom the Software is furnished to do so, subject to
the following conditions: the following conditions:
The above copyright notice and this permission notice shall be included The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software. in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
...@@ -13,4 +13,4 @@ Creates a new instance of the contract at the passed address. ...@@ -13,4 +13,4 @@ Creates a new instance of the contract at the passed address.
setCompleted(uint completed) onlyOwner** setCompleted(uint completed) onlyOwner**
"""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""
Sets the last time that a migration was completed. Sets the last time that a migration was completed.
\ No newline at end of file
...@@ -24,4 +24,4 @@ Only runs if pause mechanism is activated. ...@@ -24,4 +24,4 @@ Only runs if pause mechanism is activated.
unpause() onlyOwner whenPaused returns (bool) unpause() onlyOwner whenPaused returns (bool)
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Deactivates the pause mechanism. Deactivates the pause mechanism.
\ No newline at end of file
...@@ -21,4 +21,4 @@ Checks that b is not greater than a before subtracting. ...@@ -21,4 +21,4 @@ Checks that b is not greater than a before subtracting.
add(uint256 a, uint256 b) internal returns (uint256) add(uint256 a, uint256 b) internal returns (uint256)
""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""
Checks that the result is greater than both a and b. Checks that the result is greater than both a and b.
\ No newline at end of file
...@@ -23,4 +23,4 @@ Transfers tokens from an account that the sender is approved to transfer from. A ...@@ -23,4 +23,4 @@ Transfers tokens from an account that the sender is approved to transfer from. A
function transfer(address _to, uint _value) returns (bool success) function transfer(address _to, uint _value) returns (bool success)
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Transfers tokens from sender's account. Amount must not be greater than sender's balance. Transfers tokens from sender's account. Amount must not be greater than sender's balance.
\ No newline at end of file
...@@ -29,7 +29,7 @@ contract('BasicToken', function(accounts) { ...@@ -29,7 +29,7 @@ contract('BasicToken', function(accounts) {
assert.fail('should have thrown before'); assert.fail('should have thrown before');
} catch(error) { } catch(error) {
assertJump(error); assertJump(error);
} }
}); });
it('should throw an error when trying to transfer to 0x0', async function() { it('should throw an error when trying to transfer to 0x0', async function() {
......
...@@ -15,7 +15,7 @@ function awaitEvent(event, handler) { ...@@ -15,7 +15,7 @@ function awaitEvent(event, handler) {
function wrappedHandler(...args) { function wrappedHandler(...args) {
Promise.resolve(handler(...args)).then(resolve).catch(reject); Promise.resolve(handler(...args)).then(resolve).catch(reject);
} }
event.watch(wrappedHandler); event.watch(wrappedHandler);
}); });
} }
...@@ -90,7 +90,7 @@ contract('Bounty', function(accounts) { ...@@ -90,7 +90,7 @@ contract('Bounty', function(accounts) {
let reward = web3.toWei(1, 'ether'); let reward = web3.toWei(1, 'ether');
let bounty = await InsecureTargetBounty.new(); let bounty = await InsecureTargetBounty.new();
let event = bounty.TargetCreated({}); let event = bounty.TargetCreated({});
let watcher = async function(err, result) { let watcher = async function(err, result) {
event.stopWatching(); event.stopWatching();
if (err) { throw err; } if (err) { throw err; }
......
...@@ -12,7 +12,7 @@ require('chai') ...@@ -12,7 +12,7 @@ require('chai')
const expect = require('chai').expect const expect = require('chai').expect
contract('BurnableToken', function (accounts) { contract('BurnableToken', function (accounts) {
let token let token
let expectedTokenSupply = new BigNumber(999) let expectedTokenSupply = new BigNumber(999)
beforeEach(async function () { beforeEach(async function () {
...@@ -34,6 +34,6 @@ contract('BurnableToken', function (accounts) { ...@@ -34,6 +34,6 @@ contract('BurnableToken', function (accounts) {
it('cannot burn more tokens than your balance', async function () { it('cannot burn more tokens than your balance', async function () {
await token.burn(2000, { from: accounts[0] }) await token.burn(2000, { from: accounts[0] })
.should.be.rejectedWith(EVMThrow) .should.be.rejectedWith(EVMThrow)
}) })
}) })
\ No newline at end of file
...@@ -115,31 +115,31 @@ contract('Crowdsale', function ([_, investor, wallet, purchaser]) { ...@@ -115,31 +115,31 @@ contract('Crowdsale', function ([_, investor, wallet, purchaser]) {
beforeEach(async function() { beforeEach(async function() {
await increaseTimeTo(this.startTime) await increaseTimeTo(this.startTime)
}) })
it('should log purchase', async function () { it('should log purchase', async function () {
const {logs} = await this.crowdsale.buyTokens(investor, {value: value, from: purchaser}) const {logs} = await this.crowdsale.buyTokens(investor, {value: value, from: purchaser})
const event = logs.find(e => e.event === 'TokenPurchase') const event = logs.find(e => e.event === 'TokenPurchase')
should.exist(event) should.exist(event)
event.args.purchaser.should.equal(purchaser) event.args.purchaser.should.equal(purchaser)
event.args.beneficiary.should.equal(investor) event.args.beneficiary.should.equal(investor)
event.args.value.should.be.bignumber.equal(value) event.args.value.should.be.bignumber.equal(value)
event.args.amount.should.be.bignumber.equal(expectedTokenAmount) event.args.amount.should.be.bignumber.equal(expectedTokenAmount)
}) })
it('should increase totalSupply', async function () { it('should increase totalSupply', async function () {
await this.crowdsale.buyTokens(investor, {value, from: purchaser}) await this.crowdsale.buyTokens(investor, {value, from: purchaser})
const totalSupply = await this.token.totalSupply() const totalSupply = await this.token.totalSupply()
totalSupply.should.be.bignumber.equal(expectedTokenAmount) totalSupply.should.be.bignumber.equal(expectedTokenAmount)
}) })
it('should assign tokens to beneficiary', async function () { it('should assign tokens to beneficiary', async function () {
await this.crowdsale.buyTokens(investor, {value, from: purchaser}) await this.crowdsale.buyTokens(investor, {value, from: purchaser})
const balance = await this.token.balanceOf(investor) const balance = await this.token.balanceOf(investor)
balance.should.be.bignumber.equal(expectedTokenAmount) balance.should.be.bignumber.equal(expectedTokenAmount)
}) })
it('should forward funds to wallet', async function () { it('should forward funds to wallet', async function () {
const pre = web3.eth.getBalance(wallet) const pre = web3.eth.getBalance(wallet)
await this.crowdsale.buyTokens(investor, {value, from: purchaser}) await this.crowdsale.buyTokens(investor, {value, from: purchaser})
......
...@@ -31,7 +31,7 @@ contract('LimitBalance', function(accounts) { ...@@ -31,7 +31,7 @@ contract('LimitBalance', function(accounts) {
assert.fail('should have thrown before'); assert.fail('should have thrown before');
} catch(error) { } catch(error) {
assertJump(error); assertJump(error);
} }
}); });
it('should allow multiple sends below limit', async function() { it('should allow multiple sends below limit', async function() {
...@@ -55,7 +55,7 @@ contract('LimitBalance', function(accounts) { ...@@ -55,7 +55,7 @@ contract('LimitBalance', function(accounts) {
assert.fail('should have thrown before'); assert.fail('should have thrown before');
} catch(error) { } catch(error) {
assertJump(error); assertJump(error);
} }
}); });
}); });
...@@ -32,7 +32,7 @@ contract('Mintable', function(accounts) { ...@@ -32,7 +32,7 @@ contract('Mintable', function(accounts) {
let balance0 = await token.balanceOf(accounts[0]); let balance0 = await token.balanceOf(accounts[0]);
assert(balance0, 100); assert(balance0, 100);
let totalSupply = await token.totalSupply(); let totalSupply = await token.totalSupply();
assert(totalSupply, 100); assert(totalSupply, 100);
}) })
......
...@@ -45,4 +45,4 @@ contract('Ownable', function(accounts) { ...@@ -45,4 +45,4 @@ contract('Ownable', function(accounts) {
} }
}); });
}); });
\ No newline at end of file
...@@ -53,7 +53,7 @@ contract('PausableToken', function(accounts) { ...@@ -53,7 +53,7 @@ contract('PausableToken', function(accounts) {
it('should throw an error trying to transfer while transactions are paused', async function() { it('should throw an error trying to transfer while transactions are paused', async function() {
await token.pause(); await token.pause();
try { try {
await token.transfer(accounts[1], 100); await token.transfer(accounts[1], 100);
assert.fail('should have thrown before'); assert.fail('should have thrown before');
} catch (error) { } catch (error) {
...@@ -63,11 +63,11 @@ contract('PausableToken', function(accounts) { ...@@ -63,11 +63,11 @@ contract('PausableToken', function(accounts) {
it('should throw an error trying to transfer from another account while transactions are paused', async function() { it('should throw an error trying to transfer from another account while transactions are paused', async function() {
await token.pause(); await token.pause();
try { try {
await token.transferFrom(accounts[0], accounts[1], 100); await token.transferFrom(accounts[0], accounts[1], 100);
assert.fail('should have thrown before'); assert.fail('should have thrown before');
} catch (error) { } catch (error) {
assertJump(error); assertJump(error);
} }
}); });
}) })
\ No newline at end of file
...@@ -3,11 +3,11 @@ var PullPaymentMock = artifacts.require("./helpers/PullPaymentMock.sol"); ...@@ -3,11 +3,11 @@ var PullPaymentMock = artifacts.require("./helpers/PullPaymentMock.sol");
contract('PullPayment', function(accounts) { contract('PullPayment', function(accounts) {
let ppce; let ppce;
let amount = 17*1e18; let amount = 17*1e18;
beforeEach(async function() { beforeEach(async function() {
ppce = await PullPaymentMock.new({value: amount}); ppce = await PullPaymentMock.new({value: amount});
}); });
it("can't call asyncSend externally", async function() { it("can't call asyncSend externally", async function() {
assert.isUndefined(ppce.asyncSend); assert.isUndefined(ppce.asyncSend);
}); });
......
...@@ -34,7 +34,7 @@ contract('Crowdsale', function ([owner, wallet, investor]) { ...@@ -34,7 +34,7 @@ contract('Crowdsale', function ([owner, wallet, investor]) {
this.token = SampleCrowdsaleToken.at(await this.crowdsale.token()); this.token = SampleCrowdsaleToken.at(await this.crowdsale.token());
}); });
it('should create crowdsale with correct parameters', async function () { it('should create crowdsale with correct parameters', async function () {
this.crowdsale.should.exist; this.crowdsale.should.exist;
this.token.should.exist; this.token.should.exist;
......
...@@ -6,11 +6,11 @@ var StandardTokenMock = artifacts.require('./helpers/StandardTokenMock.sol'); ...@@ -6,11 +6,11 @@ var StandardTokenMock = artifacts.require('./helpers/StandardTokenMock.sol');
contract('StandardToken', function(accounts) { contract('StandardToken', function(accounts) {
let token; let token;
beforeEach(async function() { beforeEach(async function() {
token = await StandardTokenMock.new(accounts[0], 100); token = await StandardTokenMock.new(accounts[0], 100);
}); });
it('should return the correct totalSupply after construction', async function() { it('should return the correct totalSupply after construction', async function() {
let totalSupply = await token.totalSupply(); let totalSupply = await token.totalSupply();
...@@ -72,7 +72,7 @@ contract('StandardToken', function(accounts) { ...@@ -72,7 +72,7 @@ contract('StandardToken', function(accounts) {
describe('validating allowance updates to spender', function() { describe('validating allowance updates to spender', function() {
let preApproved; let preApproved;
it('should start with zero', async function() { it('should start with zero', async function() {
preApproved = await token.allowance(accounts[0], accounts[1]); preApproved = await token.allowance(accounts[0], accounts[1]);
assert.equal(preApproved, 0); assert.equal(preApproved, 0);
......
...@@ -10,7 +10,7 @@ contract('TokenDestructible', function(accounts) { ...@@ -10,7 +10,7 @@ contract('TokenDestructible', function(accounts) {
beforeEach(async function() { beforeEach(async function() {
destructible = await TokenDestructible.new({fron: accounts[0], value: web3.toWei('10', 'ether')}); destructible = await TokenDestructible.new({fron: accounts[0], value: web3.toWei('10', 'ether')});
}); });
it('should send balance to owner after destruction', async function() { it('should send balance to owner after destruction', async function() {
let owner = await destructible.owner(); let owner = await destructible.owner();
let initBalance = web3.eth.getBalance(owner); let initBalance = web3.eth.getBalance(owner);
......
...@@ -9,4 +9,4 @@ contract BurnableTokenMock is BurnableToken { ...@@ -9,4 +9,4 @@ contract BurnableTokenMock is BurnableToken {
totalSupply = initialBalance; totalSupply = initialBalance;
} }
} }
\ No newline at end of file
...@@ -14,7 +14,7 @@ contract CappedCrowdsaleImpl is CappedCrowdsale { ...@@ -14,7 +14,7 @@ contract CappedCrowdsaleImpl is CappedCrowdsale {
uint256 _cap uint256 _cap
) )
Crowdsale(_startTime, _endTime, _rate, _wallet) Crowdsale(_startTime, _endTime, _rate, _wallet)
CappedCrowdsale(_cap) CappedCrowdsale(_cap)
{ {
} }
......
...@@ -13,7 +13,7 @@ contract FinalizableCrowdsaleImpl is FinalizableCrowdsale { ...@@ -13,7 +13,7 @@ contract FinalizableCrowdsaleImpl is FinalizableCrowdsale {
address _wallet address _wallet
) )
Crowdsale(_startTime, _endTime, _rate, _wallet) Crowdsale(_startTime, _endTime, _rate, _wallet)
FinalizableCrowdsale() FinalizableCrowdsale()
{ {
} }
......
...@@ -14,7 +14,7 @@ contract RefundableCrowdsaleImpl is RefundableCrowdsale { ...@@ -14,7 +14,7 @@ contract RefundableCrowdsaleImpl is RefundableCrowdsale {
uint256 _goal uint256 _goal
) )
Crowdsale(_startTime, _endTime, _rate, _wallet) Crowdsale(_startTime, _endTime, _rate, _wallet)
RefundableCrowdsale(_goal) RefundableCrowdsale(_goal)
{ {
} }
......
...@@ -44,5 +44,5 @@ export const duration = { ...@@ -44,5 +44,5 @@ export const duration = {
hours: function(val) { return val * this.minutes(60) }, hours: function(val) { return val * this.minutes(60) },
days: function(val) { return val * this.hours(24) }, days: function(val) { return val * this.hours(24) },
weeks: function(val) { return val * this.days(7) }, weeks: function(val) { return val * this.days(7) },
years: function(val) { return val * this.days(365)} years: function(val) { return val * this.days(365)}
}; };
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module.exports = s => { module.exports = s => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
web3.currentProvider.sendAsync({ web3.currentProvider.sendAsync({
jsonrpc: '2.0', jsonrpc: '2.0',
method: 'evm_increaseTime', method: 'evm_increaseTime',
params: [s], // 60 seaconds, may need to be hex, I forget params: [s], // 60 seaconds, may need to be hex, I forget
id: new Date().getTime() // Id of the request; anything works, really id: new Date().getTime() // Id of the request; anything works, really
......
...@@ -23,10 +23,10 @@ module.exports = { ...@@ -23,10 +23,10 @@ module.exports = {
}, },
coverage: { coverage: {
host: "localhost", host: "localhost",
network_id: "*", network_id: "*",
port: 8555, port: 8555,
gas: 0xfffffffffff, gas: 0xfffffffffff,
gasPrice: 0x01 gasPrice: 0x01
} }
} }
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment