Upgrade to Truffle version 3.2.2 and Solidity version 0.4.11
This commit is contained in:
@ -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 &
|
||||
|
||||
@ -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:
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
|
||||
import './payment/PullPayment.sol';
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
/**
|
||||
* @title DayLimit
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
|
||||
import "./ownership/Multisig.sol";
|
||||
@ -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);
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
/**
|
||||
* @title Helps contracts guard agains rentrancy attacks.
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
|
||||
import "../ownership/Ownable.sol";
|
||||
@ -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.
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
|
||||
import '../ownership/Ownable.sol';
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
|
||||
import "../ownership/Ownable.sol";
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
|
||||
import "../ownership/Ownable.sol";
|
||||
@ -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
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
|
||||
import './Ownable.sol';
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
import './Ownable.sol';
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
|
||||
import './Claimable.sol';
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
import "./Ownable.sol";
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
import "./Ownable.sol";
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
import "./Ownable.sol";
|
||||
import "../token/ERC20Basic.sol";
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
import "./HasNoEther.sol";
|
||||
import "./HasNoTokens.sol";
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
|
||||
import '../SafeMath.sol';
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
|
||||
import './ERC20Basic.sol';
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
|
||||
import "./StandardToken.sol";
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
|
||||
import './ERC20Basic.sol';
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
import "./ERC20.sol";
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
|
||||
import './StandardToken.sol';
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
import './StandardToken.sol';
|
||||
import '../lifecycle/Pausable.sol';
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
|
||||
import "./StandardToken.sol";
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
|
||||
import './BasicToken.sol';
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
import "./StandardToken.sol";
|
||||
import "./LimitedTransferToken.sol";
|
||||
|
||||
@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@ -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]);
|
||||
});
|
||||
@ -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);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
|
||||
import '../../contracts/token/BasicToken.sol';
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
import "../../contracts/DayLimit.sol";
|
||||
|
||||
contract DayLimitMock is DayLimit {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
|
||||
import '../../contracts/token/BasicToken.sol';
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
// @title Force Ether into a contract.
|
||||
// @notice even
|
||||
@ -6,8 +6,10 @@ pragma solidity ^0.4.8;
|
||||
// @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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
import "../../contracts/ownership/HasNoEther.sol";
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
|
||||
import {Bounty, Target} from "../../contracts/Bounty.sol";
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
|
||||
import '../../contracts/LimitBalance.sol';
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
import "../../contracts/MultisigWallet.sol";
|
||||
|
||||
contract MultisigWalletMock is MultisigWallet {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
|
||||
import '../../contracts/lifecycle/Pausable.sol';
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
import '../../contracts/token/PausableToken.sol';
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
|
||||
import '../../contracts/payment/PullPayment.sol';
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
contract ReentrancyAttack {
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
import '../../contracts/ReentrancyGuard.sol';
|
||||
import './ReentrancyAttack.sol';
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
|
||||
import '../../contracts/SafeMath.sol';
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
|
||||
import {Bounty, Target} from "../../contracts/Bounty.sol";
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
import "../../contracts/ownership/Shareable.sol";
|
||||
|
||||
contract ShareableMock is Shareable {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
|
||||
import '../../contracts/token/StandardToken.sol';
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
pragma solidity ^0.4.8;
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
import '../../contracts/token/VestedToken.sol';
|
||||
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
module.exports = function(error) {
|
||||
assert.isAbove(error.message.search('invalid JUMP'), -1, 'Invalid JUMP error must be returned');
|
||||
assert.isAbove(error.message.search('invalid opcode'), -1, 'Invalid opcode error must be returned');
|
||||
}
|
||||
|
||||
@ -4,14 +4,14 @@ export default async promise => {
|
||||
} catch (error) {
|
||||
// TODO: Check jump destination to destinguish between a throw
|
||||
// and an actual invalid jump.
|
||||
const invalidJump = error.message.search('invalid JUMP') >= 0;
|
||||
const invalidOpcode = error.message.search('invalid opcode') >= 0;
|
||||
// TODO: When we contract A calls contract B, and B throws, instead
|
||||
// of an 'invalid jump', we get an 'out of gas' error. How do
|
||||
// we distinguish this from an actual out of gas event? (The
|
||||
// testrpc log actually show an 'invalid jump' event.)
|
||||
const outOfGas = error.message.search('out of gas') >= 0;
|
||||
assert(
|
||||
invalidJump || outOfGas,
|
||||
invalidOpcode || outOfGas,
|
||||
"Expected throw, got '" + error + "' instead",
|
||||
);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user