Skip to content

Commit

Permalink
Merge pull request OpenZeppelin#242 from DavidKnott/upgrade-truffle-a…
Browse files Browse the repository at this point in the history
…nd-solidity

Upgrade to Truffle version 3.2.2 and Solidity version 0.4.11
  • Loading branch information
maraoz authored Jun 7, 2017
2 parents 2e775a7 + b840d0a commit 786cc69
Show file tree
Hide file tree
Showing 56 changed files with 71 additions and 63 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ language: node_js
node_js:
- "6"
before_install:
- npm install truffle@3.1.9 -g
- npm install truffle@3.2.2 -g
- npm i -g ethereumjs-testrpc
script:
- testrpc > /dev/null &
Expand Down
2 changes: 1 addition & 1 deletion audit/ZeppelinAudit.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ We think much more could be done here, and recommend the OpenZeppelin team keep

## Solidity Version Updates Recommended

Most of the code uses Solidity 0.4.8, but some files under `Ownership` are marked 0.4.0. These should be updated.
Most of the code uses Solidity 0.4.11, but some files under `Ownership` are marked 0.4.0. These should be updated.

Solidity 0.4.10 will add several features which could be useful in these contracts:

Expand Down
2 changes: 1 addition & 1 deletion contracts/Bounty.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;


import './payment/PullPayment.sol';
Expand Down
2 changes: 1 addition & 1 deletion contracts/DayLimit.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;

/**
* @title DayLimit
Expand Down
2 changes: 1 addition & 1 deletion contracts/LimitBalance.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;


/**
Expand Down
4 changes: 2 additions & 2 deletions contracts/MultisigWallet.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;


import "./ownership/Multisig.sol";
Expand Down Expand Up @@ -93,7 +93,7 @@ contract MultisigWallet is Multisig, Shareable, DayLimit {

/**
* @dev Updates the daily limit value.
* @param _newLimit
* @param _newLimit Uint to represent the new limit.
*/
function setDailyLimit(uint _newLimit) onlymanyowners(keccak256(msg.data)) external {
_setDailyLimit(_newLimit);
Expand Down
2 changes: 1 addition & 1 deletion contracts/ReentrancyGuard.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;

/**
* @title Helps contracts guard agains rentrancy attacks.
Expand Down
2 changes: 1 addition & 1 deletion contracts/SafeMath.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;


/**
Expand Down
4 changes: 3 additions & 1 deletion contracts/lifecycle/Destructible.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;


import "../ownership/Ownable.sol";
Expand All @@ -10,6 +10,8 @@ import "../ownership/Ownable.sol";
*/
contract Destructible is Ownable {

function Destructible() payable { }

/**
* @dev Transfers the current balance to the owner and terminates the contract.
*/
Expand Down
2 changes: 1 addition & 1 deletion contracts/lifecycle/Migrations.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;


import '../ownership/Ownable.sol';
Expand Down
2 changes: 1 addition & 1 deletion contracts/lifecycle/Pausable.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;


import "../ownership/Ownable.sol";
Expand Down
4 changes: 3 additions & 1 deletion contracts/lifecycle/TokenDestructible.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;


import "../ownership/Ownable.sol";
Expand All @@ -12,6 +12,8 @@ import "../token/ERC20Basic.sol";
*/
contract TokenDestructible is Ownable {

function TokenDestructible() payable { }

/**
* @notice Terminate contract and refund to owner
* @param tokens List of addresses of ERC20 or ERC20Basic token contracts to
Expand Down
2 changes: 1 addition & 1 deletion contracts/ownership/Claimable.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;


import './Ownable.sol';
Expand Down
2 changes: 1 addition & 1 deletion contracts/ownership/Contactable.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;

import './Ownable.sol';

Expand Down
2 changes: 1 addition & 1 deletion contracts/ownership/DelayedClaimable.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;


import './Claimable.sol';
Expand Down
2 changes: 1 addition & 1 deletion contracts/ownership/HasNoContracts.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;

import "./Ownable.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/ownership/HasNoEther.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;

import "./Ownable.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/ownership/HasNoTokens.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;

import "./Ownable.sol";
import "../token/ERC20Basic.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/ownership/Multisig.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;


/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/ownership/NoOwner.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;

import "./HasNoEther.sol";
import "./HasNoTokens.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/ownership/Ownable.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;


/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/ownership/Shareable.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;


/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/payment/PullPayment.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;


import '../SafeMath.sol';
Expand Down
2 changes: 1 addition & 1 deletion contracts/token/BasicToken.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;


import './ERC20Basic.sol';
Expand Down
2 changes: 1 addition & 1 deletion contracts/token/CrowdsaleToken.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;


import "./StandardToken.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/token/ERC20.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;


import './ERC20Basic.sol';
Expand Down
2 changes: 1 addition & 1 deletion contracts/token/ERC20Basic.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;


/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/token/LimitedTransferToken.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;

import "./ERC20.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/token/MintableToken.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;


import './StandardToken.sol';
Expand Down
2 changes: 1 addition & 1 deletion contracts/token/PausableToken.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;

import './StandardToken.sol';
import '../lifecycle/Pausable.sol';
Expand Down
2 changes: 1 addition & 1 deletion contracts/token/SimpleToken.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;


import "./StandardToken.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/token/StandardToken.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;


import './BasicToken.sol';
Expand Down
2 changes: 1 addition & 1 deletion contracts/token/VestedToken.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;

import "./StandardToken.sol";
import "./LimitedTransferToken.sol";
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@
"ethereumjs-testrpc": "^3.0.2",
"mocha-lcov-reporter": "^1.3.0",
"solidity-coverage": "^0.1.0",
"truffle": "https://github.com/ConsenSys/truffle.git#3.1.9"
"truffle": "3.2.2"
}
}
4 changes: 2 additions & 2 deletions test/DelayedClaimble.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ contract('DelayedClaimable', function(accounts) {
} catch (error) {
err = error;
}
assert.isFalse(err.message.search('invalid JUMP') === -1);
assert.isFalse(err.message.search('invalid opcode') === -1);
let owner = await delayedClaimable.owner();
assert.isTrue(owner !== accounts[1]);
});
Expand All @@ -62,7 +62,7 @@ contract('DelayedClaimable', function(accounts) {
} catch (error) {
err = error;
}
assert.isFalse(err.message.search('invalid JUMP') === -1);
assert.isFalse(err.message.search('invalid opcode') === -1);
});

});
6 changes: 4 additions & 2 deletions test/HasNoEther.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ contract('HasNoEther', function(accounts) {
assert.equal(startBalance, 0);

// Force ether into it
await ForceEther.new(hasNoEther.address, {value: amount});
let forceEther = await ForceEther.new({value: amount});
await forceEther.destroyAndSend(hasNoEther.address);
const forcedBalance = await web3.eth.getBalance(hasNoEther.address);
assert.equal(forcedBalance, amount);

Expand All @@ -53,7 +54,8 @@ contract('HasNoEther', function(accounts) {
let hasNoEther = await HasNoEtherTest.new({from: accounts[0]});

// Force ether into it
await ForceEther.new(hasNoEther.address, {value: amount});
let forceEther = await ForceEther.new({value: amount});
await forceEther.destroyAndSend(hasNoEther.address);
const forcedBalance = await web3.eth.getBalance(hasNoEther.address);
assert.equal(forcedBalance, amount);

Expand Down
2 changes: 1 addition & 1 deletion test/helpers/BasicTokenMock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;


import '../../contracts/token/BasicToken.sol';
Expand Down
2 changes: 1 addition & 1 deletion test/helpers/DayLimitMock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;
import "../../contracts/DayLimit.sol";

contract DayLimitMock is DayLimit {
Expand Down
2 changes: 1 addition & 1 deletion test/helpers/ERC23TokenMock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;


import '../../contracts/token/BasicToken.sol';
Expand Down
10 changes: 6 additions & 4 deletions test/helpers/ForceEther.sol
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;

// @title Force Ether into a contract.
// @notice even
// if the contract is not payable.
// @notice To use, construct the contract with the target as argument.
// @author Remco Bloemen <remco@neufund.org>
contract ForceEther {
function ForceEther(address target) payable {
// Selfdestruct transfers all Ether to the arget address
selfdestruct(target);

function ForceEther() payable { }

function destroyAndSend(address _recipient) {
selfdestruct(_recipient);
}
}
2 changes: 1 addition & 1 deletion test/helpers/HasNoEtherTest.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;

import "../../contracts/ownership/HasNoEther.sol";

Expand Down
2 changes: 1 addition & 1 deletion test/helpers/InsecureTargetBounty.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;


import {Bounty, Target} from "../../contracts/Bounty.sol";
Expand Down
2 changes: 1 addition & 1 deletion test/helpers/LimitBalanceMock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;


import '../../contracts/LimitBalance.sol';
Expand Down
2 changes: 1 addition & 1 deletion test/helpers/MultisigWalletMock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;
import "../../contracts/MultisigWallet.sol";

contract MultisigWalletMock is MultisigWallet {
Expand Down
2 changes: 1 addition & 1 deletion test/helpers/PausableMock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;


import '../../contracts/lifecycle/Pausable.sol';
Expand Down
2 changes: 1 addition & 1 deletion test/helpers/PausableTokenMock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;

import '../../contracts/token/PausableToken.sol';

Expand Down
2 changes: 1 addition & 1 deletion test/helpers/PullPaymentMock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;


import '../../contracts/payment/PullPayment.sol';
Expand Down
2 changes: 1 addition & 1 deletion test/helpers/ReentrancyAttack.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;

contract ReentrancyAttack {

Expand Down
2 changes: 1 addition & 1 deletion test/helpers/ReentrancyMock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;

import '../../contracts/ReentrancyGuard.sol';
import './ReentrancyAttack.sol';
Expand Down
2 changes: 1 addition & 1 deletion test/helpers/SafeMathMock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;


import '../../contracts/SafeMath.sol';
Expand Down
2 changes: 1 addition & 1 deletion test/helpers/SecureTargetBounty.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;


import {Bounty, Target} from "../../contracts/Bounty.sol";
Expand Down
2 changes: 1 addition & 1 deletion test/helpers/ShareableMock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;
import "../../contracts/ownership/Shareable.sol";

contract ShareableMock is Shareable {
Expand Down
2 changes: 1 addition & 1 deletion test/helpers/StandardTokenMock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;


import '../../contracts/token/StandardToken.sol';
Expand Down
2 changes: 1 addition & 1 deletion test/helpers/VestedTokenMock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.8;
pragma solidity ^0.4.11;

import '../../contracts/token/VestedToken.sol';

Expand Down
Loading

0 comments on commit 786cc69

Please sign in to comment.