Unverified Commit 0bcf0a20 by Alejandro Santander Committed by GitHub

Merge pull request #573 from ajsantander/master

Update to truffle 4.0.0 and solc 0.4.18
parents 12303cea 0eaa5f50
......@@ -6,13 +6,6 @@ node_js:
- "6"
cache:
yarn: true
env:
-
- SOLIDITY_COVERAGE=true
matrix:
fast_finish: true
allow_failures:
- env: SOLIDITY_COVERAGE=true
before_script:
- truffle version
- yarn list
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import './payment/PullPayment.sol';
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
/**
* @title DayLimit
......@@ -59,7 +59,7 @@ contract DayLimit {
* @dev Private function to determine today's index
* @return uint256 of today's index.
*/
function today() private constant returns (uint256) {
function today() private view returns (uint256) {
return now / 1 days;
}
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
/**
......@@ -14,7 +14,7 @@ library ECRecovery {
* @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address.
* @param sig bytes signature, the signature is generated using web3.eth.sign()
*/
function recover(bytes32 hash, bytes sig) public constant returns (address) {
function recover(bytes32 hash, bytes sig) public pure returns (address) {
bytes32 r;
bytes32 s;
uint8 v;
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
/**
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
/*
* @title MerkleProof
......@@ -13,7 +13,7 @@ library MerkleProof {
* @param _root Merkle root
* @param _leaf Leaf of Merkle tree
*/
function verifyProof(bytes _proof, bytes32 _root, bytes32 _leaf) constant returns (bool) {
function verifyProof(bytes _proof, bytes32 _root, bytes32 _leaf) pure returns (bool) {
// Check if proof length is a multiple of 32
if (_proof.length % 32 != 0) return false;
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
/**
* @title Helps contracts guard agains rentrancy attacks.
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import '../math/SafeMath.sol';
import './Crowdsale.sol';
......@@ -19,14 +19,14 @@ contract CappedCrowdsale is Crowdsale {
// overriding Crowdsale#validPurchase to add extra cap logic
// @return true if investors can buy at the moment
function validPurchase() internal constant returns (bool) {
function validPurchase() internal view returns (bool) {
bool withinCap = weiRaised.add(msg.value) <= cap;
return super.validPurchase() && withinCap;
}
// overriding Crowdsale#hasEnded to add cap logic
// @return true if crowdsale event has ended
function hasEnded() public constant returns (bool) {
function hasEnded() public view returns (bool) {
bool capReached = weiRaised >= cap;
return super.hasEnded() || capReached;
}
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import '../token/MintableToken.sol';
import '../math/SafeMath.sol';
......@@ -91,14 +91,14 @@ contract Crowdsale {
}
// @return true if the transaction can buy tokens
function validPurchase() internal constant returns (bool) {
function validPurchase() internal view returns (bool) {
bool withinPeriod = now >= startTime && now <= endTime;
bool nonZeroPurchase = msg.value != 0;
return withinPeriod && nonZeroPurchase;
}
// @return true if crowdsale event has ended
function hasEnded() public constant returns (bool) {
function hasEnded() public view returns (bool) {
return now > endTime;
}
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import '../math/SafeMath.sol';
import '../ownership/Ownable.sol';
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import '../math/SafeMath.sol';
import '../ownership/Ownable.sol';
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import '../math/SafeMath.sol';
......@@ -53,7 +53,7 @@ contract RefundableCrowdsale is FinalizableCrowdsale {
super.finalization();
}
function goalReached() public constant returns (bool) {
function goalReached() public view returns (bool) {
return weiRaised >= goal;
}
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import "../crowdsale/CappedCrowdsale.sol";
import "../crowdsale/RefundableCrowdsale.sol";
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import "../token/StandardToken.sol";
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import "../ownership/Ownable.sol";
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import '../ownership/Ownable.sol';
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import "../ownership/Ownable.sol";
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import "../ownership/Ownable.sol";
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
/**
* @title Math
......@@ -6,19 +6,19 @@ pragma solidity ^0.4.11;
*/
library Math {
function max64(uint64 a, uint64 b) internal constant returns (uint64) {
function max64(uint64 a, uint64 b) internal pure returns (uint64) {
return a >= b ? a : b;
}
function min64(uint64 a, uint64 b) internal constant returns (uint64) {
function min64(uint64 a, uint64 b) internal pure returns (uint64) {
return a < b ? a : b;
}
function max256(uint256 a, uint256 b) internal constant returns (uint256) {
function max256(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
function min256(uint256 a, uint256 b) internal constant returns (uint256) {
function min256(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
}
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
/**
......@@ -6,7 +6,7 @@ pragma solidity ^0.4.11;
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
......@@ -15,19 +15,19 @@ library SafeMath {
return c;
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import "./Ownable.sol";
import "../token/ERC20Basic.sol";
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import './Ownable.sol';
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import './Ownable.sol';
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import './Claimable.sol';
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import "./Ownable.sol";
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import "./Ownable.sol";
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import "./CanReclaimToken.sol";
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import "./HasNoEther.sol";
import "./HasNoTokens.sol";
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
/**
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import '../math/SafeMath.sol';
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import '../math/SafeMath.sol';
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import './ERC20Basic.sol';
......@@ -35,7 +35,7 @@ contract BasicToken is ERC20Basic {
* @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) public constant returns (uint256 balance) {
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
......
pragma solidity ^0.4.13;
pragma solidity ^0.4.18;
import './StandardToken.sol';
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import './ERC20.sol';
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import './ERC20Basic.sol';
......@@ -9,7 +9,7 @@ import './ERC20Basic.sol';
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public constant returns (uint256);
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
/**
......@@ -8,7 +8,7 @@ pragma solidity ^0.4.11;
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import './StandardToken.sol';
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import './StandardToken.sol';
import '../lifecycle/Pausable.sol';
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import './ERC20Basic.sol';
import './ERC20.sol';
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import './BasicToken.sol';
......@@ -57,7 +57,7 @@ contract StandardToken is ERC20, BasicToken {
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public constant returns (uint256) {
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import './ERC20Basic.sol';
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import './ERC20Basic.sol';
import './SafeERC20.sol';
......@@ -91,7 +91,7 @@ contract TokenVesting is Ownable {
* @dev Calculates the amount that has already vested but hasn't been released yet.
* @param token ERC20 token which is being vested
*/
function releasableAmount(ERC20Basic token) public constant returns (uint256) {
function releasableAmount(ERC20Basic token) public view returns (uint256) {
return vestedAmount(token).sub(released[token]);
}
......@@ -99,7 +99,7 @@ contract TokenVesting is Ownable {
* @dev Calculates the amount that has already vested.
* @param token ERC20 token which is being vested
*/
function vestedAmount(ERC20Basic token) public constant returns (uint256) {
function vestedAmount(ERC20Basic token) public view returns (uint256) {
uint256 currentBalance = token.balanceOf(this);
uint256 totalBalance = currentBalance.add(released[token]);
......
......@@ -2704,6 +2704,12 @@
"secp256k1": "3.3.0"
}
},
"he": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz",
"integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=",
"dev": true
},
"hmac-drbg": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz",
......@@ -5281,14 +5287,14 @@
"dev": true
},
"truffle": {
"version": "3.4.8",
"resolved": "https://registry.npmjs.org/truffle/-/truffle-3.4.8.tgz",
"integrity": "sha512-UeMrofHcguSwfAa5Oy3+arWPWb5zd28stySKIanNhzByV1rcUy3WhxE5up4LBOxAPz+OsH1nQ02kqIcBZDwxIw==",
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/truffle/-/truffle-4.0.1.tgz",
"integrity": "sha512-PybO+GMq3AvsfCWfEx4sbuaJlDL19iR8Ff20cO0TtP599N5JbMLlhwlffvVInPgFjP+F11vjSOYj3hT8fONs5A==",
"dev": true,
"requires": {
"mocha": "3.5.0",
"mocha": "3.5.3",
"original-require": "1.0.1",
"solc": "0.4.13"
"solc": "0.4.18"
},
"dependencies": {
"commander": {
......@@ -5321,9 +5327,9 @@
}
},
"mocha": {
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/mocha/-/mocha-3.5.0.tgz",
"integrity": "sha512-pIU2PJjrPYvYRqVpjXzj76qltO9uBYI7woYAMoxbSefsa+vqAfptjoeevd6bUgwD0mPIO+hv9f7ltvsNreL2PA==",
"version": "3.5.3",
"resolved": "https://registry.npmjs.org/mocha/-/mocha-3.5.3.tgz",
"integrity": "sha512-/6na001MJWEtYxHOV1WLfsmR4YIynkUEhBwzsb+fk2qmQ3iqsi258l/Q2MWHJMImAcNpZ8DEdYAK72NHoIQ9Eg==",
"dev": true,
"requires": {
"browser-stdout": "1.3.0",
......@@ -5333,6 +5339,7 @@
"escape-string-regexp": "1.0.5",
"glob": "7.1.1",
"growl": "1.9.2",
"he": "1.1.1",
"json3": "3.3.2",
"lodash.create": "3.1.1",
"mkdirp": "0.5.1",
......@@ -5340,9 +5347,9 @@
}
},
"solc": {
"version": "0.4.13",
"resolved": "https://registry.npmjs.org/solc/-/solc-0.4.13.tgz",
"integrity": "sha1-qly9zOPmrjwZDSD1/fi8iAcC7HU=",
"version": "0.4.18",
"resolved": "https://registry.npmjs.org/solc/-/solc-0.4.18.tgz",
"integrity": "sha512-Kq+O3PNF9Pfq7fB+lDYAuoqRdghLmZyfngsg0h1Hj38NKAeVHeGPOGeZasn5KqdPeCzbMFvaGyTySxzGv6aXCg==",
"dev": true,
"requires": {
"fs-extra": "0.30.0",
......@@ -5360,28 +5367,6 @@
"requires": {
"has-flag": "1.0.0"
}
},
"yargs": {
"version": "4.8.1",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz",
"integrity": "sha1-wMQpJMpKqmsObaFznfshZDn53cA=",
"dev": true,
"requires": {
"cliui": "3.2.0",
"decamelize": "1.2.0",
"get-caller-file": "1.0.2",
"lodash.assign": "4.2.0",
"os-locale": "1.4.0",
"read-pkg-up": "1.0.1",
"require-directory": "2.1.1",
"require-main-filename": "1.0.1",
"set-blocking": "2.0.0",
"string-width": "1.0.2",
"which-module": "1.0.0",
"window-size": "0.2.0",
"y18n": "3.2.1",
"yargs-parser": "2.4.1"
}
}
}
},
......@@ -6019,6 +6004,28 @@
"integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=",
"dev": true
},
"yargs": {
"version": "4.8.1",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz",
"integrity": "sha1-wMQpJMpKqmsObaFznfshZDn53cA=",
"dev": true,
"requires": {
"cliui": "3.2.0",
"decamelize": "1.2.0",
"get-caller-file": "1.0.2",
"lodash.assign": "4.2.0",
"os-locale": "1.4.0",
"read-pkg-up": "1.0.1",
"require-directory": "2.1.1",
"require-main-filename": "1.0.1",
"set-blocking": "2.0.0",
"string-width": "1.0.2",
"which-module": "1.0.0",
"window-size": "0.2.0",
"y18n": "3.2.1",
"yargs-parser": "2.4.1"
}
},
"yargs-parser": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz",
......
......@@ -39,7 +39,7 @@
"ethereumjs-testrpc": "^4.1.1",
"mocha-lcov-reporter": "^1.3.0",
"solidity-coverage": "^0.2.2",
"truffle": "^3.4.6",
"truffle": "^4.0.0",
"truffle-hdwallet-provider": "0.0.3"
}
}
......@@ -41,7 +41,7 @@ start_testrpc() {
if [ "$SOLIDITY_COVERAGE" = true ]; then
node_modules/.bin/testrpc-sc --gasLimit 0xfffffffffff --port "$testrpc_port" "${accounts[@]}" > /dev/null &
else
node_modules/.bin/testrpc "${accounts[@]}" > /dev/null &
node_modules/.bin/testrpc --gasLimit 0xfffffffffff "${accounts[@]}" > /dev/null &
fi
testrpc_pid=$!
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import '../../contracts/token/BasicToken.sol';
......
pragma solidity ^0.4.13;
pragma solidity ^0.4.18;
import '../../contracts/token/BurnableToken.sol';
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import '../../contracts/crowdsale/CappedCrowdsale.sol';
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import "../../contracts/DayLimit.sol";
contract DayLimitMock is DayLimit {
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import '../../contracts/token/StandardToken.sol';
import '../../contracts/token/DetailedERC20.sol';
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import '../../contracts/token/BasicToken.sol';
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import '../../contracts/crowdsale/FinalizableCrowdsale.sol';
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
// @title Force Ether into a contract.
// @notice even
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import "../../contracts/ownership/HasNoEther.sol";
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import {Bounty, Target} from "../../contracts/Bounty.sol";
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import '../../contracts/LimitBalance.sol';
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import '../../contracts/lifecycle/Pausable.sol';
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import '../../contracts/token/PausableToken.sol';
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import '../../contracts/payment/PullPayment.sol';
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
contract ReentrancyAttack {
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import '../../contracts/ReentrancyGuard.sol';
import './ReentrancyAttack.sol';
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import '../../contracts/crowdsale/RefundableCrowdsale.sol';
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import '../../contracts/token/ERC20.sol';
import '../../contracts/token/SafeERC20.sol';
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import '../../contracts/math/SafeMath.sol';
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import {Bounty, Target} from "../../contracts/Bounty.sol";
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import '../../contracts/payment/SplitPayment.sol';
......
pragma solidity ^0.4.11;
pragma solidity ^0.4.18;
import '../../contracts/token/StandardToken.sol';
......
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