@@ -45,28 +45,28 @@ contract TokenInterface {
45
45
46
46
/// @param _owner The address from which the balance will be retrieved
47
47
/// @return The balance
48
- function balanceOf (address _owner ) constant returns (uint256 balance );
48
+ function balanceOf (address _owner ) public constant returns (uint256 balance );
49
49
50
50
/// @notice Send `_amount` tokens to `_to` from `msg.sender`
51
51
/// @param _to The address of the recipient
52
52
/// @param _amount The amount of tokens to be transferred
53
53
/// @return Whether the transfer was successful or not
54
- function transfer (address _to , uint256 _amount ) returns (bool success );
54
+ function transfer (address _to , uint256 _amount ) public returns (bool success );
55
55
56
56
/// @notice Send `_amount` tokens to `_to` from `_from` on the condition it
57
57
/// is approved by `_from`
58
58
/// @param _from The address of the origin of the transfer
59
59
/// @param _to The address of the recipient
60
60
/// @param _amount The amount of tokens to be transferred
61
61
/// @return Whether the transfer was successful or not
62
- function transferFrom (address _from , address _to , uint256 _amount ) returns (bool success );
62
+ function transferFrom (address _from , address _to , uint256 _amount ) public returns (bool success );
63
63
64
64
/// @notice `msg.sender` approves `_spender` to spend `_amount` tokens on
65
65
/// its behalf
66
66
/// @param _spender The address of the account able to transfer the tokens
67
67
/// @param _amount The amount of tokens to be approved for transfer
68
68
/// @return Whether the approval was successful or not
69
- function approve (address _spender , uint256 _amount ) returns (bool success );
69
+ function approve (address _spender , uint256 _amount ) public returns (bool success );
70
70
71
71
/// @param _owner The address of the account owning tokens
72
72
/// @param _spender The address of the account able to transfer the tokens
@@ -75,7 +75,7 @@ contract TokenInterface {
75
75
function allowance (
76
76
address _owner ,
77
77
address _spender
78
- ) constant returns (uint256 remaining );
78
+ ) public constant returns (uint256 remaining );
79
79
80
80
event Transfer (address indexed _from , address indexed _to , uint256 _amount );
81
81
event Approval (
@@ -86,19 +86,19 @@ contract TokenInterface {
86
86
}
87
87
88
88
contract tokenRecipient {
89
- function receiveApproval (address _from , uint256 _value , address _token , bytes _extraData );
89
+ function receiveApproval (address _from , uint256 _value , address _token , bytes _extraData ) public ;
90
90
}
91
91
92
92
contract Token is TokenInterface {
93
93
// Protects users by preventing the execution of method calls that
94
94
// inadvertently also transferred ether
95
95
modifier noEther () {if (msg .value > 0 ) revert (); _; }
96
96
97
- function balanceOf (address _owner ) constant returns (uint256 balance ) {
97
+ function balanceOf (address _owner ) public constant returns (uint256 balance ) {
98
98
return balances[_owner];
99
99
}
100
100
101
- function transfer (address _to , uint256 _amount ) noEther returns (bool success ) {
101
+ function transfer (address _to , uint256 _amount ) noEther public returns (bool success ) {
102
102
if (balances[msg .sender ] >= _amount && _amount > 0 ) {
103
103
balances[msg .sender ] -= _amount;
104
104
balances[_to] += _amount;
@@ -113,7 +113,7 @@ contract Token is TokenInterface {
113
113
address _from ,
114
114
address _to ,
115
115
uint256 _amount
116
- ) noEther returns (bool success ) {
116
+ ) noEther public returns (bool success ) {
117
117
118
118
if (balances[_from] >= _amount
119
119
&& allowed[_from][msg .sender ] >= _amount
@@ -129,22 +129,22 @@ contract Token is TokenInterface {
129
129
}
130
130
}
131
131
132
- function approve (address _spender , uint256 _amount ) returns (bool success ) {
132
+ function approve (address _spender , uint256 _amount ) public returns (bool success ) {
133
133
allowed[msg .sender ][_spender] = _amount;
134
134
Approval (msg .sender , _spender, _amount);
135
135
return true ;
136
136
}
137
137
138
138
/// Allow another contract to spend some tokens in your behalf
139
139
function approveAndCall (address _spender , uint256 _value , bytes _extraData )
140
- returns (bool success ) {
140
+ public returns (bool success ) {
141
141
allowed[msg .sender ][_spender] = _value;
142
142
tokenRecipient spender = tokenRecipient (_spender);
143
143
spender.receiveApproval (msg .sender , _value, this , _extraData);
144
144
return true ;
145
145
}
146
146
147
- function allowance (address _owner , address _spender ) constant returns (uint256 remaining ) {
147
+ function allowance (address _owner , address _spender ) public constant returns (uint256 remaining ) {
148
148
return allowed[_owner][_spender];
149
149
}
150
150
}
0 commit comments