@@ -44,7 +44,7 @@ contract WalletSimple {
44
44
*
45
45
* @param allowedSigners An array of signers on the wallet
46
46
*/
47
- function WalletSimple (address [] allowedSigners ) {
47
+ function WalletSimple (address [] allowedSigners ) public {
48
48
if (allowedSigners.length != 3 ) {
49
49
// Invalid number of signers
50
50
throw ;
@@ -55,7 +55,7 @@ contract WalletSimple {
55
55
/**
56
56
* Gets called when a transaction is received without calling a method
57
57
*/
58
- function () payable {
58
+ function () public payable {
59
59
if (msg .value > 0 ) {
60
60
// Fire deposited event if we are receiving funds
61
61
Deposited (msg .sender , msg .value , msg .data );
@@ -74,7 +74,14 @@ contract WalletSimple {
74
74
* @param sequenceId the unique sequence id obtainable from getNextSequenceId
75
75
* @param signature the result of eth.sign on the operationHash sha3(toAddress, value, data, expireTime, sequenceId)
76
76
*/
77
- function sendMultiSig (address toAddress , uint value , bytes data , uint expireTime , uint sequenceId , bytes signature ) onlysigner {
77
+ function sendMultiSig (
78
+ address toAddress ,
79
+ uint value ,
80
+ bytes data ,
81
+ uint expireTime ,
82
+ uint sequenceId ,
83
+ bytes signature
84
+ ) public onlysigner {
78
85
// Verify the other signer
79
86
var operationHash = sha3 ("ETHER " , toAddress, value, data, expireTime, sequenceId);
80
87
@@ -100,7 +107,14 @@ contract WalletSimple {
100
107
* @param sequenceId the unique sequence id obtainable from getNextSequenceId
101
108
* @param signature the result of eth.sign on the operationHash sha3(toAddress, value, tokenContractAddress, expireTime, sequenceId)
102
109
*/
103
- function sendMultiSigToken (address toAddress , uint value , address tokenContractAddress , uint expireTime , uint sequenceId , bytes signature ) onlysigner {
110
+ function sendMultiSigToken (
111
+ address toAddress ,
112
+ uint value ,
113
+ address tokenContractAddress ,
114
+ uint expireTime ,
115
+ uint sequenceId ,
116
+ bytes signature
117
+ ) public onlysigner {
104
118
// Verify the other signer
105
119
var operationHash = sha3 ("ERC20 " , toAddress, value, tokenContractAddress, expireTime, sequenceId);
106
120
@@ -122,7 +136,13 @@ contract WalletSimple {
122
136
* @param sequenceId the unique sequence id obtainable from getNextSequenceId
123
137
* returns address of the address to send tokens or eth to
124
138
*/
125
- function verifyMultiSig (address toAddress , bytes32 operationHash , bytes signature , uint expireTime , uint sequenceId ) private returns (address ) {
139
+ function verifyMultiSig (
140
+ address toAddress ,
141
+ bytes32 operationHash ,
142
+ bytes signature ,
143
+ uint expireTime ,
144
+ uint sequenceId
145
+ ) private returns (address ) {
126
146
127
147
var otherSigner = recoverAddressFromSignature (operationHash, signature);
128
148
@@ -155,7 +175,7 @@ contract WalletSimple {
155
175
/**
156
176
* Irrevocably puts contract into safe mode. When in this mode, transactions may only be sent to signing addresses.
157
177
*/
158
- function activateSafeMode () onlysigner {
178
+ function activateSafeMode () public onlysigner {
159
179
safeMode = true ;
160
180
SafeModeActivated (msg .sender );
161
181
}
@@ -165,7 +185,7 @@ contract WalletSimple {
165
185
* @param signer address to check
166
186
* returns boolean indicating whether address is signer or not
167
187
*/
168
- function isSigner (address signer ) returns (bool ) {
188
+ function isSigner (address signer ) public view returns (bool ) {
169
189
// Iterate through all signers on the wallet and
170
190
for (uint i = 0 ; i < signers.length ; i++ ) {
171
191
if (signers[i] == signer) {
@@ -181,7 +201,10 @@ contract WalletSimple {
181
201
* @param signature the tightly packed signature of r, s, and v as an array of 65 bytes (returned by eth.sign)
182
202
* returns address recovered from the signature
183
203
*/
184
- function recoverAddressFromSignature (bytes32 operationHash , bytes signature ) private returns (address ) {
204
+ function recoverAddressFromSignature (
205
+ bytes32 operationHash ,
206
+ bytes signature
207
+ ) private pure returns (address ) {
185
208
if (signature.length != 65 ) {
186
209
throw ;
187
210
}
@@ -206,7 +229,7 @@ contract WalletSimple {
206
229
* greater than the minimum element in the window.
207
230
* @param sequenceId to insert into array of stored ids
208
231
*/
209
- function tryInsertSequenceId (uint sequenceId ) onlysigner private {
232
+ function tryInsertSequenceId (uint sequenceId ) private onlysigner {
210
233
// Keep a pointer to the lowest value element in the window
211
234
uint lowestValueIndex = 0 ;
212
235
for (uint i = 0 ; i < SEQUENCE_ID_WINDOW_SIZE; i++ ) {
@@ -235,7 +258,7 @@ contract WalletSimple {
235
258
* Gets the next available sequence ID for signing when using executeAndConfirm
236
259
* returns the sequenceId one higher than the highest currently stored
237
260
*/
238
- function getNextSequenceId () returns (uint ) {
261
+ function getNextSequenceId () public view returns (uint ) {
239
262
uint highestSequenceId = 0 ;
240
263
for (uint i = 0 ; i < SEQUENCE_ID_WINDOW_SIZE; i++ ) {
241
264
if (recentSequenceIds[i] > highestSequenceId) {
0 commit comments