Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
openzeppelin-contracts-upgradeable
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
openzeppelin-contracts-upgradeable
Commits
6d8bb497
Commit
6d8bb497
authored
Sep 16, 2017
by
Roy Blankman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removing trailing whitespace
parent
1737555b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
45 changed files
with
93 additions
and
112 deletions
+93
-112
.gitignore
.gitignore
+1
-2
.solcover.js
.solcover.js
+1
-2
.soliumignore
.soliumignore
+1
-2
LICENSE
LICENSE
+8
-8
ZeppelinAudit.md
audit/ZeppelinAudit.md
+0
-0
Crowdsale.sol
contracts/crowdsale/Crowdsale.sol
+4
-4
FinalizableCrowdsale.sol
contracts/crowdsale/FinalizableCrowdsale.sol
+2
-2
SampleCrowdsale.sol
contracts/examples/SampleCrowdsale.sol
+1
-2
Destructible.sol
contracts/lifecycle/Destructible.sol
+2
-2
TokenDestructible.sol
contracts/lifecycle/TokenDestructible.sol
+3
-3
Contactable.sol
contracts/ownership/Contactable.sol
+1
-1
HasNoContracts.sol
contracts/ownership/HasNoContracts.sol
+1
-1
NoOwner.sol
contracts/ownership/NoOwner.sol
+2
-2
Ownable.sol
contracts/ownership/Ownable.sol
+1
-1
BasicToken.sol
contracts/token/BasicToken.sol
+2
-2
StandardToken.sol
contracts/token/StandardToken.sol
+4
-4
Makefile
docs/Makefile
+1
-2
basictoken.rst
docs/source/basictoken.rst
+1
-2
developer-resources.rst
docs/source/developer-resources.rst
+1
-2
index.rst
docs/source/index.rst
+5
-6
killable.rst
docs/source/killable.rst
+1
-2
license.rst
docs/source/license.rst
+9
-10
migrations.rst
docs/source/migrations.rst
+1
-2
pausable.rst
docs/source/pausable.rst
+1
-2
safemath.rst
docs/source/safemath.rst
+1
-2
standardtoken.rst
docs/source/standardtoken.rst
+1
-2
BasicToken.js
test/BasicToken.js
+1
-1
Bounty.js
test/Bounty.js
+2
-2
BurnableToken.js
test/BurnableToken.js
+3
-4
Crowdsale.js
test/Crowdsale.js
+6
-6
LimitBalance.js
test/LimitBalance.js
+2
-2
MintableToken.js
test/MintableToken.js
+1
-1
Ownable.js
test/Ownable.js
+1
-2
PausableToken.js
test/PausableToken.js
+3
-4
PullPayment.js
test/PullPayment.js
+2
-2
SampleCrowdsale.js
test/SampleCrowdsale.js
+1
-1
StandardToken.js
test/StandardToken.js
+3
-3
TokenDestructible.js
test/TokenDestructible.js
+1
-1
BurnableTokenMock.sol
test/helpers/BurnableTokenMock.sol
+1
-2
CappedCrowdsaleImpl.sol
test/helpers/CappedCrowdsaleImpl.sol
+1
-1
FinalizableCrowdsaleImpl.sol
test/helpers/FinalizableCrowdsaleImpl.sol
+1
-1
RefundableCrowdsaleImpl.sol
test/helpers/RefundableCrowdsaleImpl.sol
+1
-1
increaseTime.js
test/helpers/increaseTime.js
+2
-3
timer.js
test/helpers/timer.js
+1
-1
truffle-config.js
truffle-config.js
+4
-4
No files found.
.gitignore
View file @
6d8bb497
...
...
@@ -6,4 +6,4 @@ build/
/coverage
coverage.json
allFiredEvents
scTopics
\ No newline at end of file
scTopics
.solcover.js
View file @
6d8bb497
...
...
@@ -2,4 +2,4 @@ module.exports = {
norpc
:
true
,
testCommand
:
'node --max-old-space-size=4096 ../node_modules/.bin/truffle test --network coverage'
,
skipFiles
:
[
'lifecycle/Migrations.sol'
]
}
\ No newline at end of file
}
.soliumignore
View file @
6d8bb497
node_modules
\ No newline at end of file
node_modules
LICENSE
View file @
6d8bb497
...
...
@@ -5,18 +5,18 @@ Copyright (c) 2016 Smart Contract Solutions, Inc.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"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
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 above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
audit/ZeppelinAudit.md
View file @
6d8bb497
This diff is collapsed.
Click to expand it.
contracts/crowdsale/Crowdsale.sol
View file @
6d8bb497
...
...
@@ -4,11 +4,11 @@ import '../token/MintableToken.sol';
import '../math/SafeMath.sol';
/**
* @title Crowdsale
* @title Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale.
* Crowdsales have a start and end timestamps, where investors can make
* 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.
*/
contract Crowdsale {
...
...
@@ -36,7 +36,7 @@ contract Crowdsale {
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
*/
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
...
...
@@ -53,7 +53,7 @@ contract Crowdsale {
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.
function createTokenContract() internal returns (MintableToken) {
return new MintableToken();
...
...
contracts/crowdsale/FinalizableCrowdsale.sol
View file @
6d8bb497
...
...
@@ -7,7 +7,7 @@ import './Crowdsale.sol';
/**
* @title FinalizableCrowdsale
* @dev Extension of Crowsdale where an owner can do extra work
* after finishing.
* after finishing.
*/
contract FinalizableCrowdsale is Crowdsale, Ownable {
using SafeMath for uint256;
...
...
@@ -26,7 +26,7 @@ contract FinalizableCrowdsale is Crowdsale, Ownable {
finalization();
Finalized();
isFinalized = true;
}
...
...
contracts/examples/SampleCrowdsale.sol
View file @
6d8bb497
...
...
@@ -45,4 +45,4 @@ contract SampleCrowdsale is CappedCrowdsale, RefundableCrowdsale {
return new SampleCrowdsaleToken();
}
}
\ No newline at end of file
}
contracts/lifecycle/Destructible.sol
View file @
6d8bb497
...
...
@@ -10,10 +10,10 @@ import "../ownership/Ownable.sol";
*/
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 {
selfdestruct(owner);
...
...
contracts/lifecycle/TokenDestructible.sol
View file @
6d8bb497
...
...
@@ -4,7 +4,7 @@ pragma solidity ^0.4.11;
import "../ownership/Ownable.sol";
import "../token/ERC20Basic.sol";
/**
/**
* @title TokenDestructible:
* @author Remco Bloemen <remco@2π.com>
* @dev Base contract that can be destroyed by owner. All funds in contract including
...
...
@@ -12,9 +12,9 @@ import "../token/ERC20Basic.sol";
*/
contract TokenDestructible is Ownable {
function TokenDestructible() payable { }
function TokenDestructible() payable { }
/**
/**
* @notice Terminate contract and refund to owner
* @param tokens List of addresses of ERC20 or ERC20Basic token contracts to
refund.
...
...
contracts/ownership/Contactable.sol
View file @
6d8bb497
...
...
@@ -4,7 +4,7 @@ import './Ownable.sol';
/**
* @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.
*/
contract Contactable is Ownable{
...
...
contracts/ownership/HasNoContracts.sol
View file @
6d8bb497
...
...
@@ -2,7 +2,7 @@ pragma solidity ^0.4.11;
import "./Ownable.sol";
/**
/**
* @title Contracts that should not own Contracts
* @author Remco Bloemen <remco@2π.com>
* @dev Should contracts (anything Ownable) end up being owned by this contract, it allows the owner
...
...
contracts/ownership/NoOwner.sol
View file @
6d8bb497
...
...
@@ -4,10 +4,10 @@ import "./HasNoEther.sol";
import "./HasNoTokens.sol";
import "./HasNoContracts.sol";
/**
/**
* @title Base contract for contracts that should not own things.
* @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.
*/
contract NoOwner is HasNoEther, HasNoTokens, HasNoContracts {
...
...
contracts/ownership/Ownable.sol
View file @
6d8bb497
...
...
@@ -36,7 +36,7 @@ contract Ownable {
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner {
require(newOwner != address(0));
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
...
...
contracts/token/BasicToken.sol
View file @
6d8bb497
...
...
@@ -7,7 +7,7 @@ import '../math/SafeMath.sol';
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
...
...
@@ -31,7 +31,7 @@ contract BasicToken is ERC20Basic {
/**
* @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.
*/
function balanceOf(address _owner) constant returns (uint256 balance) {
...
...
contracts/token/StandardToken.sol
View file @
6d8bb497
...
...
@@ -65,21 +65,21 @@ contract StandardToken is ERC20, BasicToken {
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/**
* 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)
* From MonolithDAO Token.sol
*/
function increaseApproval (address _spender, uint _addedValue)
function increaseApproval (address _spender, uint _addedValue)
returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval (address _spender, uint _subtractedValue)
function decreaseApproval (address _spender, uint _subtractedValue)
returns (bool success) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
...
...
docs/Makefile
View file @
6d8bb497
...
...
@@ -17,4 +17,4 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%
:
Makefile
@
$(SPHINXBUILD)
-M
$@
"
$(SOURCEDIR)
"
"
$(BUILDDIR)
"
$(SPHINXOPTS)
$(O)
\ No newline at end of file
@
$(SPHINXBUILD)
-M
$@
"
$(SOURCEDIR)
"
"
$(BUILDDIR)
"
$(SPHINXOPTS)
$(O)
docs/source/basictoken.rst
View file @
6d8bb497
...
...
@@ -9,4 +9,4 @@ Returns the token balance of the passed address.
function transfer(address _to, uint _value) returns (bool success)
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Transfers tokens from sender's account. Amount must not be greater than sender's balance.
\ No newline at end of file
Transfers tokens from sender's account. Amount must not be greater than sender's balance.
docs/source/developer-resources.rst
View file @
6d8bb497
...
...
@@ -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
* Issue tracker: https://github.com/OpenZeppelin/zeppelin-solidity/issues
* Contribution guidelines: https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/CONTRIBUTING.md
\ No newline at end of file
* Contribution guidelines: https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/CONTRIBUTING.md
docs/source/index.rst
View file @
6d8bb497
...
...
@@ -6,14 +6,14 @@
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:
* using :doc:`contract-security-patterns`
* 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::
:maxdepth: 2
...
...
@@ -24,7 +24,7 @@ The code is open-source, and `available on github <https://github.com/OpenZeppel
.. toctree::
:maxdepth: 2
:caption: Smart Contracts
ownable
Pausable
destructible
...
...
@@ -41,7 +41,7 @@ The code is open-source, and `available on github <https://github.com/OpenZeppel
.. toctree::
:maxdepth: 2
:caption: Developer Resources
contract-security-patterns
developer-resources
license
\ No newline at end of file
license
docs/source/killable.rst
View file @
6d8bb497
...
...
@@ -13,4 +13,4 @@ Destroys the contract and sends funds back to the owner.
destroyAndSend(address _recipient) onlyOwner
"""""""""""""""""""
Destroys the contract and sends funds back to the _recepient.
\ No newline at end of file
Destroys the contract and sends funds back to the _recepient.
docs/source/license.rst
View file @
6d8bb497
...
...
@@ -6,18 +6,18 @@ Copyright (c) 2016 Smart Contract Solutions, Inc.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"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
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 above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
docs/source/migrations.rst
View file @
6d8bb497
...
...
@@ -13,4 +13,4 @@ Creates a new instance of the contract at the passed address.
setCompleted(uint completed) onlyOwner**
""""""""""""""""""""""""""""""""""""""""
Sets the last time that a migration was completed.
\ No newline at end of file
Sets the last time that a migration was completed.
docs/source/pausable.rst
View file @
6d8bb497
...
...
@@ -24,4 +24,4 @@ Only runs if pause mechanism is activated.
unpause() onlyOwner whenPaused returns (bool)
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Deactivates the pause mechanism.
\ No newline at end of file
Deactivates the pause mechanism.
docs/source/safemath.rst
View file @
6d8bb497
...
...
@@ -21,4 +21,4 @@ Checks that b is not greater than a before subtracting.
add(uint256 a, uint256 b) internal returns (uint256)
"""""""""""""""""""""""""""""""""""""""""""""""""
Checks that the result is greater than both a and b.
\ No newline at end of file
Checks that the result is greater than both a and b.
docs/source/standardtoken.rst
View file @
6d8bb497
...
...
@@ -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)
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Transfers tokens from sender's account. Amount must not be greater than sender's balance.
\ No newline at end of file
Transfers tokens from sender's account. Amount must not be greater than sender's balance.
test/BasicToken.js
View file @
6d8bb497
...
...
@@ -29,7 +29,7 @@ contract('BasicToken', function(accounts) {
assert
.
fail
(
'should have thrown before'
);
}
catch
(
error
)
{
assertJump
(
error
);
}
}
});
it
(
'should throw an error when trying to transfer to 0x0'
,
async
function
()
{
...
...
test/Bounty.js
View file @
6d8bb497
...
...
@@ -15,7 +15,7 @@ function awaitEvent(event, handler) {
function
wrappedHandler
(...
args
)
{
Promise
.
resolve
(
handler
(...
args
)).
then
(
resolve
).
catch
(
reject
);
}
event
.
watch
(
wrappedHandler
);
});
}
...
...
@@ -90,7 +90,7 @@ contract('Bounty', function(accounts) {
let
reward
=
web3
.
toWei
(
1
,
'ether'
);
let
bounty
=
await
InsecureTargetBounty
.
new
();
let
event
=
bounty
.
TargetCreated
({});
let
watcher
=
async
function
(
err
,
result
)
{
event
.
stopWatching
();
if
(
err
)
{
throw
err
;
}
...
...
test/BurnableToken.js
View file @
6d8bb497
...
...
@@ -12,7 +12,7 @@ require('chai')
const
expect
=
require
(
'chai'
).
expect
contract
(
'BurnableToken'
,
function
(
accounts
)
{
let
token
let
token
let
expectedTokenSupply
=
new
BigNumber
(
999
)
beforeEach
(
async
function
()
{
...
...
@@ -34,6 +34,6 @@ contract('BurnableToken', function (accounts) {
it
(
'cannot burn more tokens than your balance'
,
async
function
()
{
await
token
.
burn
(
2000
,
{
from
:
accounts
[
0
]
})
.
should
.
be
.
rejectedWith
(
EVMThrow
)
.
should
.
be
.
rejectedWith
(
EVMThrow
)
})
})
\ No newline at end of file
})
test/Crowdsale.js
View file @
6d8bb497
...
...
@@ -115,31 +115,31 @@ contract('Crowdsale', function ([_, investor, wallet, purchaser]) {
beforeEach
(
async
function
()
{
await
increaseTimeTo
(
this
.
startTime
)
})
it
(
'should log purchase'
,
async
function
()
{
const
{
logs
}
=
await
this
.
crowdsale
.
buyTokens
(
investor
,
{
value
:
value
,
from
:
purchaser
})
const
event
=
logs
.
find
(
e
=>
e
.
event
===
'TokenPurchase'
)
should
.
exist
(
event
)
event
.
args
.
purchaser
.
should
.
equal
(
purchaser
)
event
.
args
.
beneficiary
.
should
.
equal
(
investor
)
event
.
args
.
value
.
should
.
be
.
bignumber
.
equal
(
value
)
event
.
args
.
amount
.
should
.
be
.
bignumber
.
equal
(
expectedTokenAmount
)
})
it
(
'should increase totalSupply'
,
async
function
()
{
await
this
.
crowdsale
.
buyTokens
(
investor
,
{
value
,
from
:
purchaser
})
const
totalSupply
=
await
this
.
token
.
totalSupply
()
totalSupply
.
should
.
be
.
bignumber
.
equal
(
expectedTokenAmount
)
})
it
(
'should assign tokens to beneficiary'
,
async
function
()
{
await
this
.
crowdsale
.
buyTokens
(
investor
,
{
value
,
from
:
purchaser
})
const
balance
=
await
this
.
token
.
balanceOf
(
investor
)
balance
.
should
.
be
.
bignumber
.
equal
(
expectedTokenAmount
)
})
it
(
'should forward funds to wallet'
,
async
function
()
{
const
pre
=
web3
.
eth
.
getBalance
(
wallet
)
await
this
.
crowdsale
.
buyTokens
(
investor
,
{
value
,
from
:
purchaser
})
...
...
test/LimitBalance.js
View file @
6d8bb497
...
...
@@ -31,7 +31,7 @@ contract('LimitBalance', function(accounts) {
assert
.
fail
(
'should have thrown before'
);
}
catch
(
error
)
{
assertJump
(
error
);
}
}
});
it
(
'should allow multiple sends below limit'
,
async
function
()
{
...
...
@@ -55,7 +55,7 @@ contract('LimitBalance', function(accounts) {
assert
.
fail
(
'should have thrown before'
);
}
catch
(
error
)
{
assertJump
(
error
);
}
}
});
});
test/MintableToken.js
View file @
6d8bb497
...
...
@@ -32,7 +32,7 @@ contract('Mintable', function(accounts) {
let
balance0
=
await
token
.
balanceOf
(
accounts
[
0
]);
assert
(
balance0
,
100
);
let
totalSupply
=
await
token
.
totalSupply
();
assert
(
totalSupply
,
100
);
})
...
...
test/Ownable.js
View file @
6d8bb497
...
...
@@ -45,4 +45,4 @@ contract('Ownable', function(accounts) {
}
});
});
\ No newline at end of file
});
test/PausableToken.js
View file @
6d8bb497
...
...
@@ -53,7 +53,7 @@ contract('PausableToken', function(accounts) {
it
(
'should throw an error trying to transfer while transactions are paused'
,
async
function
()
{
await
token
.
pause
();
try
{
try
{
await
token
.
transfer
(
accounts
[
1
],
100
);
assert
.
fail
(
'should have thrown before'
);
}
catch
(
error
)
{
...
...
@@ -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
()
{
await
token
.
pause
();
try
{
try
{
await
token
.
transferFrom
(
accounts
[
0
],
accounts
[
1
],
100
);
assert
.
fail
(
'should have thrown before'
);
}
catch
(
error
)
{
assertJump
(
error
);
}
});
})
\ No newline at end of file
})
test/PullPayment.js
View file @
6d8bb497
...
...
@@ -3,11 +3,11 @@ var PullPaymentMock = artifacts.require("./helpers/PullPaymentMock.sol");
contract
(
'PullPayment'
,
function
(
accounts
)
{
let
ppce
;
let
amount
=
17
*
1
e18
;
beforeEach
(
async
function
()
{
ppce
=
await
PullPaymentMock
.
new
({
value
:
amount
});
});
it
(
"can't call asyncSend externally"
,
async
function
()
{
assert
.
isUndefined
(
ppce
.
asyncSend
);
});
...
...
test/SampleCrowdsale.js
View file @
6d8bb497
...
...
@@ -34,7 +34,7 @@ contract('Crowdsale', function ([owner, wallet, investor]) {
this
.
token
=
SampleCrowdsaleToken
.
at
(
await
this
.
crowdsale
.
token
());
});
it
(
'should create crowdsale with correct parameters'
,
async
function
()
{
this
.
crowdsale
.
should
.
exist
;
this
.
token
.
should
.
exist
;
...
...
test/StandardToken.js
View file @
6d8bb497
...
...
@@ -6,11 +6,11 @@ var StandardTokenMock = artifacts.require('./helpers/StandardTokenMock.sol');
contract
(
'StandardToken'
,
function
(
accounts
)
{
let
token
;
beforeEach
(
async
function
()
{
token
=
await
StandardTokenMock
.
new
(
accounts
[
0
],
100
);
});
it
(
'should return the correct totalSupply after construction'
,
async
function
()
{
let
totalSupply
=
await
token
.
totalSupply
();
...
...
@@ -72,7 +72,7 @@ contract('StandardToken', function(accounts) {
describe
(
'validating allowance updates to spender'
,
function
()
{
let
preApproved
;
it
(
'should start with zero'
,
async
function
()
{
preApproved
=
await
token
.
allowance
(
accounts
[
0
],
accounts
[
1
]);
assert
.
equal
(
preApproved
,
0
);
...
...
test/TokenDestructible.js
View file @
6d8bb497
...
...
@@ -10,7 +10,7 @@ contract('TokenDestructible', function(accounts) {
beforeEach
(
async
function
()
{
destructible
=
await
TokenDestructible
.
new
({
fron
:
accounts
[
0
],
value
:
web3
.
toWei
(
'10'
,
'ether'
)});
});
it
(
'should send balance to owner after destruction'
,
async
function
()
{
let
owner
=
await
destructible
.
owner
();
let
initBalance
=
web3
.
eth
.
getBalance
(
owner
);
...
...
test/helpers/BurnableTokenMock.sol
View file @
6d8bb497
...
...
@@ -9,4 +9,4 @@ contract BurnableTokenMock is BurnableToken {
totalSupply = initialBalance;
}
}
\ No newline at end of file
}
test/helpers/CappedCrowdsaleImpl.sol
View file @
6d8bb497
...
...
@@ -14,7 +14,7 @@ contract CappedCrowdsaleImpl is CappedCrowdsale {
uint256 _cap
)
Crowdsale(_startTime, _endTime, _rate, _wallet)
CappedCrowdsale(_cap)
CappedCrowdsale(_cap)
{
}
...
...
test/helpers/FinalizableCrowdsaleImpl.sol
View file @
6d8bb497
...
...
@@ -13,7 +13,7 @@ contract FinalizableCrowdsaleImpl is FinalizableCrowdsale {
address _wallet
)
Crowdsale(_startTime, _endTime, _rate, _wallet)
FinalizableCrowdsale()
FinalizableCrowdsale()
{
}
...
...
test/helpers/RefundableCrowdsaleImpl.sol
View file @
6d8bb497
...
...
@@ -14,7 +14,7 @@ contract RefundableCrowdsaleImpl is RefundableCrowdsale {
uint256 _goal
)
Crowdsale(_startTime, _endTime, _rate, _wallet)
RefundableCrowdsale(_goal)
RefundableCrowdsale(_goal)
{
}
...
...
test/helpers/increaseTime.js
View file @
6d8bb497
...
...
@@ -44,5 +44,5 @@ export const duration = {
hours
:
function
(
val
)
{
return
val
*
this
.
minutes
(
60
)
},
days
:
function
(
val
)
{
return
val
*
this
.
hours
(
24
)
},
weeks
:
function
(
val
)
{
return
val
*
this
.
days
(
7
)
},
years
:
function
(
val
)
{
return
val
*
this
.
days
(
365
)}
};
\ No newline at end of file
years
:
function
(
val
)
{
return
val
*
this
.
days
(
365
)}
};
test/helpers/timer.js
View file @
6d8bb497
...
...
@@ -2,7 +2,7 @@
module
.
exports
=
s
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
web3
.
currentProvider
.
sendAsync
({
jsonrpc
:
'2.0'
,
jsonrpc
:
'2.0'
,
method
:
'evm_increaseTime'
,
params
:
[
s
],
// 60 seaconds, may need to be hex, I forget
id
:
new
Date
().
getTime
()
// Id of the request; anything works, really
...
...
truffle-config.js
View file @
6d8bb497
...
...
@@ -23,10 +23,10 @@ module.exports = {
},
coverage
:
{
host
:
"localhost"
,
network_id
:
"*"
,
port
:
8555
,
gas
:
0xfffffffffff
,
gasPrice
:
0x01
network_id
:
"*"
,
port
:
8555
,
gas
:
0xfffffffffff
,
gasPrice
:
0x01
}
}
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment