@@ -36,59 +36,50 @@ contract MultiSigWallet {
36
36
}
37
37
38
38
modifier onlyWallet () {
39
- if (msg .sender != address (this ))
40
- throw ;
39
+ require (msg .sender == address (this ));
41
40
_;
42
41
}
43
42
44
43
modifier ownerDoesNotExist (address owner ) {
45
- if (isOwner[owner])
46
- throw ;
44
+ require (! isOwner[owner]);
47
45
_;
48
46
}
49
47
50
48
modifier ownerExists (address owner ) {
51
- if (! isOwner[owner])
52
- throw ;
49
+ require (isOwner[owner]);
53
50
_;
54
51
}
55
52
56
53
modifier transactionExists (uint transactionId ) {
57
- if (transactions[transactionId].destination == 0 )
58
- throw ;
54
+ require (transactions[transactionId].destination != 0 );
59
55
_;
60
56
}
61
57
62
58
modifier confirmed (uint transactionId , address owner ) {
63
- if (! confirmations[transactionId][owner])
64
- throw ;
59
+ require (confirmations[transactionId][owner]);
65
60
_;
66
61
}
67
62
68
63
modifier notConfirmed (uint transactionId , address owner ) {
69
- if (confirmations[transactionId][owner])
70
- throw ;
64
+ require (! confirmations[transactionId][owner]);
71
65
_;
72
66
}
73
67
74
68
modifier notExecuted (uint transactionId ) {
75
- if (transactions[transactionId].executed)
76
- throw ;
69
+ require (! transactions[transactionId].executed);
77
70
_;
78
71
}
79
72
80
73
modifier notNull (address _address ) {
81
- if (_address == 0 )
82
- throw ;
74
+ require (_address != 0 );
83
75
_;
84
76
}
85
77
86
78
modifier validRequirement (uint ownerCount , uint _required ) {
87
- if ( ownerCount > MAX_OWNER_COUNT
88
- || _required > ownerCount
89
- || _required == 0
90
- || ownerCount == 0 )
91
- throw ;
79
+ require (ownerCount <= MAX_OWNER_COUNT
80
+ && _required <= ownerCount
81
+ && _required != 0
82
+ && ownerCount != 0 );
92
83
_;
93
84
}
94
85
@@ -111,8 +102,7 @@ contract MultiSigWallet {
111
102
validRequirement (_owners.length , _required)
112
103
{
113
104
for (uint i= 0 ; i< _owners.length ; i++ ) {
114
- if (isOwner[_owners[i]] || _owners[i] == 0 )
115
- throw ;
105
+ require (! isOwner[_owners[i]] && _owners[i] != 0 );
116
106
isOwner[_owners[i]] = true ;
117
107
}
118
108
owners = _owners;
0 commit comments