@@ -353,7 +353,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
353
353
354
354
// Modifier that allows only shareholders to vote and create new proposals
355
355
modifier onlyTokenholders {
356
- if (balanceOf (msg .sender ) == 0 ) throw ;
356
+ if (balanceOf (msg .sender ) == 0 ) revert () ;
357
357
_;
358
358
}
359
359
@@ -381,9 +381,9 @@ contract DAO is DAOInterface, Token, TokenCreation {
381
381
rewardAccount = new ManagedAccount (address (this ), false );
382
382
DAOrewardAccount = new ManagedAccount (address (this ), false );
383
383
if (address (rewardAccount) == 0 )
384
- throw ;
384
+ revert () ;
385
385
if (address (DAOrewardAccount) == 0 )
386
- throw ;
386
+ revert () ;
387
387
lastTimeMinQuorumMet = now ;
388
388
minQuorumDivisor = 5 ; // sets the minimal quorum to 20%
389
389
proposals.length = 1 ; // avoids a proposal with ID 0 because it is used
@@ -421,30 +421,30 @@ contract DAO is DAOInterface, Token, TokenCreation {
421
421
|| _recipient == curator
422
422
|| msg .value > 0
423
423
|| _debatingPeriod < minSplitDebatePeriod)) {
424
- throw ;
424
+ revert () ;
425
425
} else if (
426
426
! _newCurator
427
427
&& (! isRecipientAllowed (_recipient) || (_debatingPeriod < minProposalDebatePeriod))
428
428
) {
429
- throw ;
429
+ revert () ;
430
430
}
431
431
432
432
if (_debatingPeriod > 8 weeks)
433
- throw ;
433
+ revert () ;
434
434
435
435
if (! isFueled
436
436
|| now < closingTime
437
437
|| (msg .value < proposalDeposit && ! _newCurator)) {
438
438
439
- throw ;
439
+ revert () ;
440
440
}
441
441
442
442
if (now + _debatingPeriod < now ) // prevents overflow
443
- throw ;
443
+ revert () ;
444
444
445
445
// to prevent a 51% attacker to convert the ether into deposit
446
446
if (msg .sender == address (this ))
447
- throw ;
447
+ revert () ;
448
448
449
449
// to prevent curator from halving quorum before first proposal
450
450
if (proposals.length == 1 ) // initial length is 1 (see constructor)
@@ -498,7 +498,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
498
498
|| p.votedNo[msg .sender ]
499
499
|| now >= p.votingDeadline) {
500
500
501
- throw ;
501
+ revert () ;
502
502
}
503
503
504
504
if (_supportsProposal) {
@@ -545,7 +545,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
545
545
// Does the transaction code match the proposal?
546
546
|| p.proposalHash != sha3 (p.recipient, p.amount, _transactionData)) {
547
547
548
- throw ;
548
+ revert () ;
549
549
}
550
550
551
551
// If the curator removed the recipient from the whitelist, close the proposal
@@ -574,7 +574,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
574
574
575
575
if (quorum >= minQuorum (p.amount)) {
576
576
if (! p.creator.send (p.proposalDeposit))
577
- throw ;
577
+ revert () ;
578
578
579
579
lastTimeMinQuorumMet = now ;
580
580
// set the minQuorum to 20% again, in the case it has been reached
@@ -591,7 +591,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
591
591
p.proposalPassed = true ;
592
592
593
593
if (! p.recipient.call.value (p.amount)(_transactionData))
594
- throw ;
594
+ revert () ;
595
595
596
596
_success = true ;
597
597
@@ -642,7 +642,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
642
642
// Did you already vote on another proposal?
643
643
|| (blocked[msg .sender ] != _proposalID && blocked[msg .sender ] != 0 ) ) {
644
644
645
- throw ;
645
+ revert () ;
646
646
}
647
647
648
648
// If the new DAO doesn't exist yet, create the new DAO and store the
@@ -651,10 +651,10 @@ contract DAO is DAOInterface, Token, TokenCreation {
651
651
p.splitData[0 ].newDAO = createNewDAO (_newCurator);
652
652
// Call depth limit reached, etc.
653
653
if (address (p.splitData[0 ].newDAO) == 0 )
654
- throw ;
654
+ revert () ;
655
655
// should never happen
656
656
if (this .balance < sumOfProposalDeposits)
657
- throw ;
657
+ revert () ;
658
658
p.splitData[0 ].splitBalance = actualBalance ();
659
659
p.splitData[0 ].rewardToken = rewardToken[address (this )];
660
660
p.splitData[0 ].totalSupply = totalSupply;
@@ -666,7 +666,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
666
666
(balances[msg .sender ] * p.splitData[0 ].splitBalance) /
667
667
p.splitData[0 ].totalSupply;
668
668
if (p.splitData[0 ].newDAO.createTokenProxy.value (fundsToBeMoved)(msg .sender ) == false )
669
- throw ;
669
+ revert () ;
670
670
671
671
672
672
// Assign reward rights to new DAO
@@ -679,12 +679,12 @@ contract DAO is DAOInterface, Token, TokenCreation {
679
679
680
680
rewardToken[address (p.splitData[0 ].newDAO)] += rewardTokenToBeMoved;
681
681
if (rewardToken[address (this )] < rewardTokenToBeMoved)
682
- throw ;
682
+ revert () ;
683
683
rewardToken[address (this )] -= rewardTokenToBeMoved;
684
684
685
685
DAOpaidOut[address (p.splitData[0 ].newDAO)] += paidOutToBeMoved;
686
686
if (DAOpaidOut[address (this )] < paidOutToBeMoved)
687
- throw ;
687
+ revert () ;
688
688
DAOpaidOut[address (this )] -= paidOutToBeMoved;
689
689
690
690
// Burn DAO Tokens
@@ -700,7 +700,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
700
700
if (msg .sender != address (this ) || ! allowedRecipients[_newContract]) return ;
701
701
// move all ether
702
702
if (! _newContract.call.value (address (this ).balance)()) {
703
- throw ;
703
+ revert () ;
704
704
}
705
705
706
706
//move all reward tokens
@@ -716,7 +716,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
716
716
717
717
if ((rewardToken[msg .sender ] * DAOrewardAccount.accumulatedInput ()) /
718
718
totalRewardToken < DAOpaidOut[msg .sender ])
719
- throw ;
719
+ revert () ;
720
720
721
721
uint reward =
722
722
(rewardToken[msg .sender ] * DAOrewardAccount.accumulatedInput ()) /
@@ -726,11 +726,11 @@ contract DAO is DAOInterface, Token, TokenCreation {
726
726
727
727
if (_toMembers) {
728
728
if (! DAOrewardAccount.payOut (dao.rewardAccount (), reward))
729
- throw ;
729
+ revert () ;
730
730
}
731
731
else {
732
732
if (! DAOrewardAccount.payOut (dao, reward))
733
- throw ;
733
+ revert () ;
734
734
}
735
735
DAOpaidOut[msg .sender ] += reward;
736
736
return true ;
@@ -743,15 +743,15 @@ contract DAO is DAOInterface, Token, TokenCreation {
743
743
744
744
function withdrawRewardFor (address _account ) noEther internal returns (bool _success ) {
745
745
if ((balanceOf (_account) * rewardAccount.accumulatedInput ()) / totalSupply < paidOut[_account])
746
- throw ;
746
+ revert () ;
747
747
748
748
uint reward =
749
749
(balanceOf (_account) * rewardAccount.accumulatedInput ()) / totalSupply - paidOut[_account];
750
750
751
751
reward = rewardAccount.balance < reward ? rewardAccount.balance : reward;
752
752
753
753
if (! rewardAccount.payOut (_account, reward))
754
- throw ;
754
+ revert () ;
755
755
paidOut[_account] += reward;
756
756
return true ;
757
757
}
@@ -767,14 +767,14 @@ contract DAO is DAOInterface, Token, TokenCreation {
767
767
768
768
return true ;
769
769
} else {
770
- throw ;
770
+ revert () ;
771
771
}
772
772
}
773
773
774
774
775
775
function transferWithoutReward (address _to , uint256 _value ) returns (bool success ) {
776
776
if (! getMyReward ())
777
- throw ;
777
+ revert () ;
778
778
return transfer (_to, _value);
779
779
}
780
780
@@ -789,7 +789,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
789
789
790
790
return true ;
791
791
} else {
792
- throw ;
792
+ revert () ;
793
793
}
794
794
}
795
795
@@ -801,7 +801,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
801
801
) returns (bool success ) {
802
802
803
803
if (! withdrawRewardFor (_from))
804
- throw ;
804
+ revert () ;
805
805
return transferFrom (_from, _to, _value);
806
806
}
807
807
@@ -814,7 +814,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
814
814
815
815
uint transferPaidOut = paidOut[_from] * _value / balanceOf (_from);
816
816
if (transferPaidOut > paidOut[_from])
817
- throw ;
817
+ revert () ;
818
818
paidOut[_from] -= transferPaidOut;
819
819
paidOut[_to] += transferPaidOut;
820
820
return true ;
@@ -825,15 +825,15 @@ contract DAO is DAOInterface, Token, TokenCreation {
825
825
if (msg .sender != address (this ) || _proposalDeposit > (actualBalance () + rewardToken[address (this )])
826
826
/ maxDepositDivisor) {
827
827
828
- throw ;
828
+ revert () ;
829
829
}
830
830
proposalDeposit = _proposalDeposit;
831
831
}
832
832
833
833
834
834
function changeAllowedRecipients (address _recipient , bool _allowed ) noEther external returns (bool _success ) {
835
835
if (msg .sender != curator)
836
- throw ;
836
+ revert () ;
837
837
allowedRecipients[_recipient] = _allowed;
838
838
AllowedRecipientChanged (_recipient, _allowed);
839
839
return true ;
0 commit comments