Skip to content

Commit

Permalink
Make contracts 4.24 compatible (OpenZeppelin#951)
Browse files Browse the repository at this point in the history
* Make contracts 4.24 compatible
  • Loading branch information
artiebits authored and shrugs committed Jun 13, 2018
1 parent e1dc141 commit 5daaf60
Show file tree
Hide file tree
Showing 112 changed files with 1,767 additions and 1,854 deletions.
2 changes: 1 addition & 1 deletion contracts/AddressUtils.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity ^0.4.24;


/**
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.23;
pragma solidity ^0.4.24;


import "./payment/PullPayment.sol";
Expand Down
5 changes: 2 additions & 3 deletions contracts/ECRecovery.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity ^0.4.24;


/**
Expand Down Expand Up @@ -69,8 +69,7 @@ library ECRecovery {
// 32 is the length in bytes of hash,
// enforced by the type signature above
return keccak256(
"\x19Ethereum Signed Message:\n32",
hash
abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)
);
}
}
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.23;
pragma solidity ^0.4.24;


/**
Expand Down
6 changes: 3 additions & 3 deletions contracts/MerkleProof.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity ^0.4.24;


/*
Expand Down Expand Up @@ -30,10 +30,10 @@ library MerkleProof {

if (computedHash < proofElement) {
// Hash(current computed hash + current element of the proof)
computedHash = keccak256(computedHash, proofElement);
computedHash = keccak256(abi.encodePacked(computedHash, proofElement));
} else {
// Hash(current element of the proof + current computed hash)
computedHash = keccak256(proofElement, computedHash);
computedHash = keccak256(abi.encodePacked(proofElement, computedHash));
}
}

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.23;
pragma solidity ^0.4.24;


/**
Expand Down
10 changes: 5 additions & 5 deletions contracts/access/SignatureBouncer.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity ^0.4.24;

import "../ownership/Ownable.sol";
import "../ownership/rbac/RBAC.sol";
Expand All @@ -16,7 +16,7 @@ import "../ECRecovery.sol";
* @dev
* @dev This technique is useful for whitelists and airdrops; instead of putting all
* @dev valid addresses on-chain, simply sign a grant of the form
* @dev keccak256(`:contractAddress` + `:granteeAddress`) using a valid bouncer address.
* @dev keccak256(abi.encodePacked(`:contractAddress` + `:granteeAddress`)) using a valid bouncer address.
* @dev Then restrict access to your crowdsale/whitelist/airdrop using the
* @dev `onlyValidSignature` modifier (or implement your own using isValidSignature).
* @dev
Expand Down Expand Up @@ -99,7 +99,7 @@ contract SignatureBouncer is Ownable, RBAC {
returns (bool)
{
return isValidDataHash(
keccak256(address(this), _address),
keccak256(abi.encodePacked(address(this), _address)),
_sig
);
}
Expand All @@ -118,7 +118,7 @@ contract SignatureBouncer is Ownable, RBAC {
data[i] = msg.data[i];
}
return isValidDataHash(
keccak256(address(this), _address, data),
keccak256(abi.encodePacked(address(this), _address, data)),
_sig
);
}
Expand All @@ -139,7 +139,7 @@ contract SignatureBouncer is Ownable, RBAC {
data[i] = msg.data[i];
}
return isValidDataHash(
keccak256(address(this), _address, data),
keccak256(abi.encodePacked(address(this), _address, data)),
_sig
);
}
Expand Down
2 changes: 1 addition & 1 deletion contracts/access/Whitelist.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity ^0.4.24;


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

import "../token/ERC20/ERC20.sol";
import "../math/SafeMath.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/crowdsale/distribution/FinalizableCrowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity ^0.4.24;

import "../../math/SafeMath.sol";
import "../../ownership/Ownable.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/crowdsale/distribution/PostDeliveryCrowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity ^0.4.24;

import "../validation/TimedCrowdsale.sol";
import "../../token/ERC20/ERC20.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/crowdsale/distribution/RefundableCrowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity ^0.4.24;


import "../../math/SafeMath.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/crowdsale/distribution/utils/RefundVault.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity ^0.4.24;

import "../../../math/SafeMath.sol";
import "../../../ownership/Ownable.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/crowdsale/emission/AllowanceCrowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity ^0.4.24;

import "../Crowdsale.sol";
import "../../token/ERC20/ERC20.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/crowdsale/emission/MintedCrowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity ^0.4.24;

import "../Crowdsale.sol";
import "../../token/ERC20/MintableToken.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/crowdsale/price/IncreasingPriceCrowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity ^0.4.24;

import "../validation/TimedCrowdsale.sol";
import "../../math/SafeMath.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/crowdsale/validation/CappedCrowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity ^0.4.24;

import "../../math/SafeMath.sol";
import "../Crowdsale.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity ^0.4.24;

import "../../math/SafeMath.sol";
import "../Crowdsale.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/crowdsale/validation/TimedCrowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity ^0.4.24;

import "../../math/SafeMath.sol";
import "../Crowdsale.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/crowdsale/validation/WhitelistedCrowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity ^0.4.24;

import "../Crowdsale.sol";
import "../../ownership/Ownable.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/examples/RBACWithAdmin.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity ^0.4.24;

import "../ownership/rbac/RBAC.sol";

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

import "../crowdsale/validation/CappedCrowdsale.sol";
import "../crowdsale/distribution/RefundableCrowdsale.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/examples/SimpleSavingsWallet.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity ^0.4.24;

import "../ownership/Heritable.sol";

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


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


/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/introspection/SupportsInterfaceWithLookup.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity ^0.4.24;

import "./ERC165.sol";

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


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.23;
pragma solidity ^0.4.24;


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

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


/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/math/SafeMath.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity ^0.4.24;


/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/AllowanceCrowdsaleImpl.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity ^0.4.24;

import "../token/ERC20/ERC20.sol";
import "../crowdsale/emission/AllowanceCrowdsale.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/BasicTokenMock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity ^0.4.24;


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

import "../access/SignatureBouncer.sol";

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

import "../token/ERC20/BurnableToken.sol";

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

import "../token/ERC20/ERC20.sol";
import "../crowdsale/validation/CappedCrowdsale.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/DetailedERC20Mock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity ^0.4.24;

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


import "../ECRecovery.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/ERC223TokenMock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity ^0.4.24;

import "../token/ERC20/BasicToken.sol";

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

import "../token/ERC721/ERC721BasicToken.sol";

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

import "../token/ERC721/ERC721Receiver.sol";

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

import "../token/ERC721/ERC721Token.sol";

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


import "../token/ERC827/ERC827Token.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/FinalizableCrowdsaleImpl.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity ^0.4.24;

import "../token/ERC20/MintableToken.sol";
import "../crowdsale/distribution/FinalizableCrowdsale.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/ForceEther.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity ^0.4.24;


// @title Force Ether into a contract.
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/HasNoEtherTest.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity ^0.4.24;

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

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

import "../crowdsale/price/IncreasingPriceCrowdsale.sol";
import "../math/SafeMath.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/IndividuallyCappedCrowdsaleImpl.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity ^0.4.24;

import "../token/ERC20/ERC20.sol";
import "../crowdsale/validation/IndividuallyCappedCrowdsale.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/InsecureTargetBounty.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity ^0.4.24;

import {Bounty, Target} from "../../contracts/Bounty.sol";

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


import "../LimitBalance.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/MathMock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity ^0.4.24;


import "../../contracts/math/Math.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/MerkleProofWrapper.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity ^0.4.24;

import { MerkleProof } from "../MerkleProof.sol";

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


contract MessageHelper {
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/MintedCrowdsaleImpl.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity ^0.4.24;

import "../token/ERC20/MintableToken.sol";
import "../crowdsale/emission/MintedCrowdsale.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/PausableMock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity ^0.4.24;


import "../lifecycle/Pausable.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/PausableTokenMock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.23;
pragma solidity ^0.4.24;

import "../token/ERC20/PausableToken.sol";

Expand Down
Loading

0 comments on commit 5daaf60

Please sign in to comment.