aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/compilationTests/MultiSigWallet/MultiSigWallet.sol20
-rw-r--r--test/compilationTests/MultiSigWallet/TestToken.sol4
-rw-r--r--test/compilationTests/corion/provider.sol2
-rw-r--r--test/compilationTests/corion/schelling.sol2
-rw-r--r--test/compilationTests/milestonetracker/MilestoneTracker.sol56
-rw-r--r--test/compilationTests/milestonetracker/RLP.sol38
-rw-r--r--test/compilationTests/zeppelin/Bounty.sol6
-rw-r--r--test/compilationTests/zeppelin/DayLimit.sol2
-rw-r--r--test/compilationTests/zeppelin/LimitBalance.sol2
-rw-r--r--test/compilationTests/zeppelin/MultisigWallet.sol4
-rw-r--r--test/compilationTests/zeppelin/ReentrancyGuard.sol2
-rw-r--r--test/compilationTests/zeppelin/lifecycle/Pausable.sol4
-rw-r--r--test/compilationTests/zeppelin/ownership/Claimable.sol2
-rw-r--r--test/compilationTests/zeppelin/ownership/DelayedClaimable.sol4
-rw-r--r--test/compilationTests/zeppelin/ownership/HasNoEther.sol4
-rw-r--r--test/compilationTests/zeppelin/ownership/HasNoTokens.sol2
-rw-r--r--test/compilationTests/zeppelin/ownership/Ownable.sol2
-rw-r--r--test/compilationTests/zeppelin/ownership/Shareable.sol6
-rw-r--r--test/compilationTests/zeppelin/payment/PullPayment.sol6
-rw-r--r--test/compilationTests/zeppelin/token/LimitedTransferToken.sol2
-rw-r--r--test/compilationTests/zeppelin/token/MintableToken.sol2
-rw-r--r--test/compilationTests/zeppelin/token/StandardToken.sol4
-rw-r--r--test/compilationTests/zeppelin/token/VestedToken.sol8
23 files changed, 92 insertions, 92 deletions
diff --git a/test/compilationTests/MultiSigWallet/MultiSigWallet.sol b/test/compilationTests/MultiSigWallet/MultiSigWallet.sol
index 0261e068..35f6208b 100644
--- a/test/compilationTests/MultiSigWallet/MultiSigWallet.sol
+++ b/test/compilationTests/MultiSigWallet/MultiSigWallet.sol
@@ -33,49 +33,49 @@ contract MultiSigWallet {
modifier onlyWallet() {
if (msg.sender != address(this))
- throw;
+ revert();
_;
}
modifier ownerDoesNotExist(address owner) {
if (isOwner[owner])
- throw;
+ revert();
_;
}
modifier ownerExists(address owner) {
if (!isOwner[owner])
- throw;
+ revert();
_;
}
modifier transactionExists(uint transactionId) {
if (transactions[transactionId].destination == address(0))
- throw;
+ revert();
_;
}
modifier confirmed(uint transactionId, address owner) {
if (!confirmations[transactionId][owner])
- throw;
+ revert();
_;
}
modifier notConfirmed(uint transactionId, address owner) {
if (confirmations[transactionId][owner])
- throw;
+ revert();
_;
}
modifier notExecuted(uint transactionId) {
if (transactions[transactionId].executed)
- throw;
+ revert();
_;
}
modifier notNull(address _address) {
if (_address == address(0))
- throw;
+ revert();
_;
}
@@ -84,7 +84,7 @@ contract MultiSigWallet {
|| _required > ownerCount
|| _required == 0
|| ownerCount == 0)
- throw;
+ revert();
_;
}
@@ -109,7 +109,7 @@ contract MultiSigWallet {
{
for (uint i=0; i<_owners.length; i++) {
if (isOwner[_owners[i]] || _owners[i] == address(0))
- throw;
+ revert();
isOwner[_owners[i]] = true;
}
owners = _owners;
diff --git a/test/compilationTests/MultiSigWallet/TestToken.sol b/test/compilationTests/MultiSigWallet/TestToken.sol
index df195c58..a100b449 100644
--- a/test/compilationTests/MultiSigWallet/TestToken.sol
+++ b/test/compilationTests/MultiSigWallet/TestToken.sol
@@ -27,7 +27,7 @@ contract TestToken {
returns (bool success)
{
if (balances[msg.sender] < _value) {
- throw;
+ revert();
}
balances[msg.sender] -= _value;
balances[_to] += _value;
@@ -40,7 +40,7 @@ contract TestToken {
returns (bool success)
{
if (balances[_from] < _value || allowed[_from][msg.sender] < _value) {
- throw;
+ revert();
}
balances[_to] += _value;
balances[_from] -= _value;
diff --git a/test/compilationTests/corion/provider.sol b/test/compilationTests/corion/provider.sol
index 3327ba8a..7d1e04e3 100644
--- a/test/compilationTests/corion/provider.sol
+++ b/test/compilationTests/corion/provider.sol
@@ -514,7 +514,7 @@ contract provider is module, safeMath, announcementTypes {
} else if ( clients[msg.sender].providerAddress != address(0x00) ) {
clientReward = getClientReward(_limit);
} else {
- throw;
+ revert();
}
if ( clientReward > 0 ) {
require( moduleHandler(moduleHandlerAddress).transfer(address(this), _beneficiary, clientReward, false) );
diff --git a/test/compilationTests/corion/schelling.sol b/test/compilationTests/corion/schelling.sol
index f236d378..3905e300 100644
--- a/test/compilationTests/corion/schelling.sol
+++ b/test/compilationTests/corion/schelling.sol
@@ -389,7 +389,7 @@ contract schelling is module, announcementTypes, schellingVars {
}
delete voter.status;
delete voter.roundID;
- } else { throw; }
+ } else { revert(); }
setVoter(msg.sender, voter);
setFunds(msg.sender, funds);
diff --git a/test/compilationTests/milestonetracker/MilestoneTracker.sol b/test/compilationTests/milestonetracker/MilestoneTracker.sol
index c123862f..856fb1a5 100644
--- a/test/compilationTests/milestonetracker/MilestoneTracker.sol
+++ b/test/compilationTests/milestonetracker/MilestoneTracker.sol
@@ -83,14 +83,14 @@ contract MilestoneTracker {
/// @dev The following modifiers only allow specific roles to call functions
/// with these modifiers
- modifier onlyRecipient { if (msg.sender != recipient) throw; _; }
- modifier onlyArbitrator { if (msg.sender != arbitrator) throw; _; }
- modifier onlyDonor { if (msg.sender != donor) throw; _; }
+ modifier onlyRecipient { if (msg.sender != recipient) revert(); _; }
+ modifier onlyArbitrator { if (msg.sender != arbitrator) revert(); _; }
+ modifier onlyDonor { if (msg.sender != donor) revert(); _; }
/// @dev The following modifiers prevent functions from being called if the
/// campaign has been canceled or if new milestones are being proposed
- modifier campaignNotCanceled { if (campaignCanceled) throw; _; }
- modifier notChanging { if (changingMilestones) throw; _; }
+ modifier campaignNotCanceled { if (campaignCanceled) revert(); _; }
+ modifier notChanging { if (changingMilestones) revert(); _; }
// @dev Events to make the payment movements easy to find on the blockchain
event NewMilestoneListProposed();
@@ -204,8 +204,8 @@ contract MilestoneTracker {
uint i;
- if (!changingMilestones) throw;
- if (keccak256(proposedMilestones) != _hashProposals) throw;
+ if (!changingMilestones) revert();
+ if (keccak256(proposedMilestones) != _hashProposals) revert();
// Cancel all the unfinished milestones
for (i=0; i<milestones.length; i++) {
@@ -218,7 +218,7 @@ contract MilestoneTracker {
RLP.RLPItem memory itmProposals = mProposedMilestones.toRLPItem(true);
- if (!itmProposals.isList()) throw;
+ if (!itmProposals.isList()) revert();
RLP.Iterator memory itrProposals = itmProposals.iterator();
@@ -229,7 +229,7 @@ contract MilestoneTracker {
Milestone storage milestone = milestones[milestones.length ++];
- if (!itmProposal.isList()) throw;
+ if (!itmProposal.isList()) revert();
RLP.Iterator memory itrProposal = itmProposal.iterator();
@@ -258,14 +258,14 @@ contract MilestoneTracker {
function markMilestoneComplete(uint _idMilestone)
public campaignNotCanceled notChanging
{
- if (_idMilestone >= milestones.length) throw;
+ if (_idMilestone >= milestones.length) revert();
Milestone storage milestone = milestones[_idMilestone];
if ( (msg.sender != milestone.milestoneLeadLink)
&&(msg.sender != recipient))
- throw;
- if (milestone.status != MilestoneStatus.AcceptedAndInProgress) throw;
- if (now < milestone.minCompletionDate) throw;
- if (now > milestone.maxCompletionDate) throw;
+ revert();
+ if (milestone.status != MilestoneStatus.AcceptedAndInProgress) revert();
+ if (now < milestone.minCompletionDate) revert();
+ if (now > milestone.maxCompletionDate) revert();
milestone.status = MilestoneStatus.Completed;
milestone.doneTime = now;
emit ProposalStatusChanged(_idMilestone, milestone.status);
@@ -276,10 +276,10 @@ contract MilestoneTracker {
function approveCompletedMilestone(uint _idMilestone)
public campaignNotCanceled notChanging
{
- if (_idMilestone >= milestones.length) throw;
+ if (_idMilestone >= milestones.length) revert();
Milestone storage milestone = milestones[_idMilestone];
if ((msg.sender != milestone.reviewer) ||
- (milestone.status != MilestoneStatus.Completed)) throw;
+ (milestone.status != MilestoneStatus.Completed)) revert();
authorizePayment(_idMilestone);
}
@@ -291,10 +291,10 @@ contract MilestoneTracker {
function rejectMilestone(uint _idMilestone)
public campaignNotCanceled notChanging
{
- if (_idMilestone >= milestones.length) throw;
+ if (_idMilestone >= milestones.length) revert();
Milestone storage milestone = milestones[_idMilestone];
if ((msg.sender != milestone.reviewer) ||
- (milestone.status != MilestoneStatus.Completed)) throw;
+ (milestone.status != MilestoneStatus.Completed)) revert();
milestone.status = MilestoneStatus.AcceptedAndInProgress;
emit ProposalStatusChanged(_idMilestone, milestone.status);
@@ -306,14 +306,14 @@ contract MilestoneTracker {
/// @param _idMilestone ID of the milestone to be paid out
function requestMilestonePayment(uint _idMilestone
) public campaignNotCanceled notChanging {
- if (_idMilestone >= milestones.length) throw;
+ if (_idMilestone >= milestones.length) revert();
Milestone storage milestone = milestones[_idMilestone];
if ( (msg.sender != milestone.milestoneLeadLink)
&&(msg.sender != recipient))
- throw;
+ revert();
if ((milestone.status != MilestoneStatus.Completed) ||
(now < milestone.doneTime + milestone.reviewTime))
- throw;
+ revert();
authorizePayment(_idMilestone);
}
@@ -323,11 +323,11 @@ contract MilestoneTracker {
function cancelMilestone(uint _idMilestone)
public onlyRecipient campaignNotCanceled notChanging
{
- if (_idMilestone >= milestones.length) throw;
+ if (_idMilestone >= milestones.length) revert();
Milestone storage milestone = milestones[_idMilestone];
if ((milestone.status != MilestoneStatus.AcceptedAndInProgress) &&
(milestone.status != MilestoneStatus.Completed))
- throw;
+ revert();
milestone.status = MilestoneStatus.Canceled;
emit ProposalStatusChanged(_idMilestone, milestone.status);
@@ -338,11 +338,11 @@ contract MilestoneTracker {
/// @param _idMilestone ID of the milestone to be paid out
function arbitrateApproveMilestone(uint _idMilestone
) public onlyArbitrator campaignNotCanceled notChanging {
- if (_idMilestone >= milestones.length) throw;
+ if (_idMilestone >= milestones.length) revert();
Milestone storage milestone = milestones[_idMilestone];
if ((milestone.status != MilestoneStatus.AcceptedAndInProgress) &&
(milestone.status != MilestoneStatus.Completed))
- throw;
+ revert();
authorizePayment(_idMilestone);
}
@@ -355,13 +355,13 @@ contract MilestoneTracker {
// @dev This internal function is executed when the milestone is paid out
function authorizePayment(uint _idMilestone) internal {
- if (_idMilestone >= milestones.length) throw;
+ if (_idMilestone >= milestones.length) revert();
Milestone storage milestone = milestones[_idMilestone];
// Recheck again to not pay twice
- if (milestone.status == MilestoneStatus.AuthorizedForPayment) throw;
+ if (milestone.status == MilestoneStatus.AuthorizedForPayment) revert();
milestone.status = MilestoneStatus.AuthorizedForPayment;
if (!milestone.paymentSource.call.value(0)(milestone.payData))
- throw;
+ revert();
emit ProposalStatusChanged(_idMilestone, milestone.status);
}
}
diff --git a/test/compilationTests/milestonetracker/RLP.sol b/test/compilationTests/milestonetracker/RLP.sol
index e96bb332..e261bf23 100644
--- a/test/compilationTests/milestonetracker/RLP.sol
+++ b/test/compilationTests/milestonetracker/RLP.sol
@@ -39,13 +39,13 @@ library RLP {
self._unsafe_nextPtr = ptr + itemLength;
}
else
- throw;
+ revert();
}
function next(Iterator memory self, bool strict) internal view returns (RLPItem memory subItem) {
subItem = next(self);
if(strict && !_validate(subItem))
- throw;
+ revert();
return;
}
@@ -80,11 +80,11 @@ library RLP {
if(strict) {
uint len = self.length;
if(_payloadOffset(item) > len)
- throw;
+ revert();
if(_itemLength(item._unsafe_memPtr) != len)
- throw;
+ revert();
if(!_validate(item))
- throw;
+ revert();
}
return item;
}
@@ -160,7 +160,7 @@ library RLP {
/// @return An 'Iterator' over the item.
function iterator(RLPItem memory self) internal view returns (Iterator memory it) {
if (!isList(self))
- throw;
+ revert();
uint ptr = self._unsafe_memPtr + _payloadOffset(self);
it._unsafe_item = self;
it._unsafe_nextPtr = ptr;
@@ -183,7 +183,7 @@ library RLP {
/// @return The decoded string.
function toData(RLPItem memory self) internal returns (bytes memory bts) {
if(!isData(self))
- throw;
+ revert();
(uint rStartPos, uint len) = _decode(self);
bts = new bytes(len);
_copyToBytes(rStartPos, bts, len);
@@ -195,7 +195,7 @@ library RLP {
/// @return Array of RLPItems.
function toList(RLPItem memory self) internal view returns (RLPItem[] memory list) {
if(!isList(self))
- throw;
+ revert();
uint numItems = items(self);
list = new RLPItem[](numItems);
Iterator memory it = iterator(self);
@@ -212,7 +212,7 @@ library RLP {
/// @return The decoded string.
function toAscii(RLPItem memory self) internal returns (string memory str) {
if(!isData(self))
- throw;
+ revert();
(uint rStartPos, uint len) = _decode(self);
bytes memory bts = new bytes(len);
_copyToBytes(rStartPos, bts, len);
@@ -225,10 +225,10 @@ library RLP {
/// @return The decoded string.
function toUint(RLPItem memory self) internal view returns (uint data) {
if(!isData(self))
- throw;
+ revert();
(uint rStartPos, uint len) = _decode(self);
if (len > 32 || len == 0)
- throw;
+ revert();
assembly {
data := div(mload(rStartPos), exp(256, sub(32, len)))
}
@@ -240,16 +240,16 @@ library RLP {
/// @return The decoded string.
function toBool(RLPItem memory self) internal view returns (bool data) {
if(!isData(self))
- throw;
+ revert();
(uint rStartPos, uint len) = _decode(self);
if (len != 1)
- throw;
+ revert();
uint temp;
assembly {
temp := byte(0, mload(rStartPos))
}
if (temp > 1)
- throw;
+ revert();
return temp == 1 ? true : false;
}
@@ -259,10 +259,10 @@ library RLP {
/// @return The decoded string.
function toByte(RLPItem memory self) internal view returns (byte data) {
if(!isData(self))
- throw;
+ revert();
(uint rStartPos, uint len) = _decode(self);
if (len != 1)
- throw;
+ revert();
uint8 temp;
assembly {
temp := byte(0, mload(rStartPos))
@@ -292,10 +292,10 @@ library RLP {
/// @return The decoded string.
function toAddress(RLPItem memory self) internal view returns (address data) {
if(!isData(self))
- throw;
+ revert();
(uint rStartPos, uint len) = _decode(self);
if (len != 20)
- throw;
+ revert();
assembly {
data := div(mload(rStartPos), exp(256, 12))
}
@@ -350,7 +350,7 @@ library RLP {
// Get start position and length of the data.
function _decode(RLPItem memory self) private view returns (uint memPtr, uint len) {
if(!isData(self))
- throw;
+ revert();
uint b0;
uint start = self._unsafe_memPtr;
assembly {
diff --git a/test/compilationTests/zeppelin/Bounty.sol b/test/compilationTests/zeppelin/Bounty.sol
index a5e75cd3..55e64071 100644
--- a/test/compilationTests/zeppelin/Bounty.sol
+++ b/test/compilationTests/zeppelin/Bounty.sol
@@ -20,7 +20,7 @@ contract Bounty is PullPayment, Destructible {
*/
function() external payable {
if (claimed) {
- throw;
+ revert();
}
}
@@ -49,11 +49,11 @@ contract Bounty is PullPayment, Destructible {
function claim(Target target) public {
address researcher = researchers[target];
if (researcher == address(0)) {
- throw;
+ revert();
}
// Check Target contract invariants
if (target.checkInvariant()) {
- throw;
+ revert();
}
asyncSend(researcher, address(this).balance);
claimed = true;
diff --git a/test/compilationTests/zeppelin/DayLimit.sol b/test/compilationTests/zeppelin/DayLimit.sol
index 5a2937b5..bc576c89 100644
--- a/test/compilationTests/zeppelin/DayLimit.sol
+++ b/test/compilationTests/zeppelin/DayLimit.sol
@@ -68,7 +68,7 @@ contract DayLimit {
*/
modifier limitedDaily(uint256 _value) {
if (!underLimit(_value)) {
- throw;
+ revert();
}
_;
}
diff --git a/test/compilationTests/zeppelin/LimitBalance.sol b/test/compilationTests/zeppelin/LimitBalance.sol
index 9682ff1c..8bf4b253 100644
--- a/test/compilationTests/zeppelin/LimitBalance.sol
+++ b/test/compilationTests/zeppelin/LimitBalance.sol
@@ -24,7 +24,7 @@ contract LimitBalance {
*/
modifier limitedPayable() {
if (address(this).balance > limit) {
- throw;
+ revert();
}
_;
diff --git a/test/compilationTests/zeppelin/MultisigWallet.sol b/test/compilationTests/zeppelin/MultisigWallet.sol
index 2d6a064a..3793428d 100644
--- a/test/compilationTests/zeppelin/MultisigWallet.sol
+++ b/test/compilationTests/zeppelin/MultisigWallet.sol
@@ -61,7 +61,7 @@ contract MultisigWallet is Multisig, Shareable, DayLimit {
emit SingleTransact(msg.sender, _value, _to, _data);
// yes - just execute the call.
if (!_to.call.value(_value)(_data)) {
- throw;
+ revert();
}
return 0;
}
@@ -83,7 +83,7 @@ contract MultisigWallet is Multisig, Shareable, DayLimit {
function confirm(bytes32 _h) onlymanyowners(_h) public returns (bool) {
if (txs[_h].to != address(0)) {
if (!txs[_h].to.call.value(txs[_h].value)(txs[_h].data)) {
- throw;
+ revert();
}
emit MultiTransact(msg.sender, _h, txs[_h].value, txs[_h].to, txs[_h].data);
delete txs[_h];
diff --git a/test/compilationTests/zeppelin/ReentrancyGuard.sol b/test/compilationTests/zeppelin/ReentrancyGuard.sol
index 60c7927b..7805ec07 100644
--- a/test/compilationTests/zeppelin/ReentrancyGuard.sol
+++ b/test/compilationTests/zeppelin/ReentrancyGuard.sol
@@ -27,7 +27,7 @@ contract ReentrancyGuard {
_;
rentrancy_lock = false;
} else {
- throw;
+ revert();
}
}
diff --git a/test/compilationTests/zeppelin/lifecycle/Pausable.sol b/test/compilationTests/zeppelin/lifecycle/Pausable.sol
index 4ffd281a..0c48f2f6 100644
--- a/test/compilationTests/zeppelin/lifecycle/Pausable.sol
+++ b/test/compilationTests/zeppelin/lifecycle/Pausable.sol
@@ -19,7 +19,7 @@ contract Pausable is Ownable {
* @dev modifier to allow actions only when the contract IS paused
*/
modifier whenNotPaused() {
- if (paused) throw;
+ if (paused) revert();
_;
}
@@ -27,7 +27,7 @@ contract Pausable is Ownable {
* @dev modifier to allow actions only when the contract IS NOT paused
*/
modifier whenPaused {
- if (!paused) throw;
+ if (!paused) revert();
_;
}
diff --git a/test/compilationTests/zeppelin/ownership/Claimable.sol b/test/compilationTests/zeppelin/ownership/Claimable.sol
index 72390411..d7b48a29 100644
--- a/test/compilationTests/zeppelin/ownership/Claimable.sol
+++ b/test/compilationTests/zeppelin/ownership/Claimable.sol
@@ -17,7 +17,7 @@ contract Claimable is Ownable {
*/
modifier onlyPendingOwner() {
if (msg.sender != pendingOwner) {
- throw;
+ revert();
}
_;
}
diff --git a/test/compilationTests/zeppelin/ownership/DelayedClaimable.sol b/test/compilationTests/zeppelin/ownership/DelayedClaimable.sol
index f019d2f1..540a2ce0 100644
--- a/test/compilationTests/zeppelin/ownership/DelayedClaimable.sol
+++ b/test/compilationTests/zeppelin/ownership/DelayedClaimable.sol
@@ -22,7 +22,7 @@ contract DelayedClaimable is Claimable {
*/
function setLimits(uint256 _start, uint256 _end) public onlyOwner {
if (_start > _end)
- throw;
+ revert();
end = _end;
start = _start;
}
@@ -34,7 +34,7 @@ contract DelayedClaimable is Claimable {
*/
function claimOwnership() public onlyPendingOwner {
if ((block.number > end) || (block.number < start))
- throw;
+ revert();
owner = pendingOwner;
pendingOwner = address(0x0);
end = 0;
diff --git a/test/compilationTests/zeppelin/ownership/HasNoEther.sol b/test/compilationTests/zeppelin/ownership/HasNoEther.sol
index 9f294679..75d90841 100644
--- a/test/compilationTests/zeppelin/ownership/HasNoEther.sol
+++ b/test/compilationTests/zeppelin/ownership/HasNoEther.sol
@@ -23,7 +23,7 @@ contract HasNoEther is Ownable {
*/
constructor() public payable {
if(msg.value > 0) {
- throw;
+ revert();
}
}
@@ -38,7 +38,7 @@ contract HasNoEther is Ownable {
*/
function reclaimEther() external onlyOwner {
if(!owner.send(address(this).balance)) {
- throw;
+ revert();
}
}
}
diff --git a/test/compilationTests/zeppelin/ownership/HasNoTokens.sol b/test/compilationTests/zeppelin/ownership/HasNoTokens.sol
index d1dc4b3e..df4284f1 100644
--- a/test/compilationTests/zeppelin/ownership/HasNoTokens.sol
+++ b/test/compilationTests/zeppelin/ownership/HasNoTokens.sol
@@ -19,7 +19,7 @@ contract HasNoTokens is Ownable {
* @param data_ Bytes The data passed from the caller.
*/
function tokenFallback(address from_, uint256 value_, bytes data_) external {
- throw;
+ revert();
}
/**
diff --git a/test/compilationTests/zeppelin/ownership/Ownable.sol b/test/compilationTests/zeppelin/ownership/Ownable.sol
index 7417b2bd..a862cb74 100644
--- a/test/compilationTests/zeppelin/ownership/Ownable.sol
+++ b/test/compilationTests/zeppelin/ownership/Ownable.sol
@@ -24,7 +24,7 @@ contract Ownable {
*/
modifier onlyOwner() {
if (msg.sender != owner) {
- throw;
+ revert();
}
_;
}
diff --git a/test/compilationTests/zeppelin/ownership/Shareable.sol b/test/compilationTests/zeppelin/ownership/Shareable.sol
index 4a6b32f0..0c8d16a5 100644
--- a/test/compilationTests/zeppelin/ownership/Shareable.sol
+++ b/test/compilationTests/zeppelin/ownership/Shareable.sol
@@ -37,7 +37,7 @@ contract Shareable {
// simple single-sig function modifier.
modifier onlyOwner {
if (!isOwner(msg.sender)) {
- throw;
+ revert();
}
_;
}
@@ -68,7 +68,7 @@ contract Shareable {
}
required = _required;
if (required > owners.length) {
- throw;
+ revert();
}
}
@@ -139,7 +139,7 @@ contract Shareable {
uint256 index = ownerIndex[msg.sender];
// make sure they're an owner
if (index == 0) {
- throw;
+ revert();
}
PendingState memory pending = pendings[_operation];
diff --git a/test/compilationTests/zeppelin/payment/PullPayment.sol b/test/compilationTests/zeppelin/payment/PullPayment.sol
index 2f3e1b51..bac1d019 100644
--- a/test/compilationTests/zeppelin/payment/PullPayment.sol
+++ b/test/compilationTests/zeppelin/payment/PullPayment.sol
@@ -33,18 +33,18 @@ contract PullPayment {
uint256 payment = payments[payee];
if (payment == 0) {
- throw;
+ revert();
}
if (address(this).balance < payment) {
- throw;
+ revert();
}
totalPayments = totalPayments.sub(payment);
payments[payee] = 0;
if (!payee.send(payment)) {
- throw;
+ revert();
}
}
}
diff --git a/test/compilationTests/zeppelin/token/LimitedTransferToken.sol b/test/compilationTests/zeppelin/token/LimitedTransferToken.sol
index 052c28e6..3ce928f6 100644
--- a/test/compilationTests/zeppelin/token/LimitedTransferToken.sol
+++ b/test/compilationTests/zeppelin/token/LimitedTransferToken.sol
@@ -23,7 +23,7 @@ contract LimitedTransferToken is ERC20 {
* @dev Checks whether it can transfer or otherwise throws.
*/
modifier canTransfer(address _sender, uint256 _value) {
- if (_value > transferableTokens(_sender, uint64(now))) throw;
+ if (_value > transferableTokens(_sender, uint64(now))) revert();
_;
}
diff --git a/test/compilationTests/zeppelin/token/MintableToken.sol b/test/compilationTests/zeppelin/token/MintableToken.sol
index f99964d0..24b8c807 100644
--- a/test/compilationTests/zeppelin/token/MintableToken.sol
+++ b/test/compilationTests/zeppelin/token/MintableToken.sol
@@ -21,7 +21,7 @@ contract MintableToken is StandardToken, Ownable {
modifier canMint() {
- if(mintingFinished) throw;
+ if(mintingFinished) revert();
_;
}
diff --git a/test/compilationTests/zeppelin/token/StandardToken.sol b/test/compilationTests/zeppelin/token/StandardToken.sol
index 94b12e57..56f4a5f3 100644
--- a/test/compilationTests/zeppelin/token/StandardToken.sol
+++ b/test/compilationTests/zeppelin/token/StandardToken.sol
@@ -27,7 +27,7 @@ contract StandardToken is ERC20, BasicToken {
uint256 _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
- // if (_value > _allowance) throw;
+ // if (_value > _allowance) revert();
balances[_to] = balances[_to].add(_value);
balances[_from] = balances[_from].sub(_value);
@@ -46,7 +46,7 @@ contract StandardToken is ERC20, BasicToken {
// allowance to zero by calling `approve(_spender, 0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
- if ((_value != 0) && (allowed[msg.sender][_spender] != 0)) throw;
+ if ((_value != 0) && (allowed[msg.sender][_spender] != 0)) revert();
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
diff --git a/test/compilationTests/zeppelin/token/VestedToken.sol b/test/compilationTests/zeppelin/token/VestedToken.sol
index 2ee2713d..ca13b638 100644
--- a/test/compilationTests/zeppelin/token/VestedToken.sol
+++ b/test/compilationTests/zeppelin/token/VestedToken.sol
@@ -46,10 +46,10 @@ contract VestedToken is StandardToken, LimitedTransferToken {
// Check for date inconsistencies that may cause unexpected behavior
if (_cliff < _start || _vesting < _cliff) {
- throw;
+ revert();
}
- if (tokenGrantsCount(_to) > MAX_GRANTS_PER_ADDRESS) throw; // To prevent a user being spammed and have his balance locked (out of gas attack when calculating vesting).
+ if (tokenGrantsCount(_to) > MAX_GRANTS_PER_ADDRESS) revert(); // To prevent a user being spammed and have his balance locked (out of gas attack when calculating vesting).
uint256 count = grants[_to].push(
TokenGrant(
@@ -77,11 +77,11 @@ contract VestedToken is StandardToken, LimitedTransferToken {
TokenGrant storage grant = grants[_holder][_grantId];
if (!grant.revokable) { // Check if grant was revokable
- throw;
+ revert();
}
if (grant.granter != msg.sender) { // Only granter can revoke it
- throw;
+ revert();
}
address receiver = grant.burnsOnRevoke ? 0xdead : msg.sender;