Skip to content

Commit 5af8c12

Browse files
committed
Update DAO to use visibility specifiers
1 parent 2d0c67a commit 5af8c12

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

test/DAO/Token.sol

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,28 +45,28 @@ contract TokenInterface {
4545

4646
/// @param _owner The address from which the balance will be retrieved
4747
/// @return The balance
48-
function balanceOf(address _owner) constant returns (uint256 balance);
48+
function balanceOf(address _owner) public constant returns (uint256 balance);
4949

5050
/// @notice Send `_amount` tokens to `_to` from `msg.sender`
5151
/// @param _to The address of the recipient
5252
/// @param _amount The amount of tokens to be transferred
5353
/// @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);
5555

5656
/// @notice Send `_amount` tokens to `_to` from `_from` on the condition it
5757
/// is approved by `_from`
5858
/// @param _from The address of the origin of the transfer
5959
/// @param _to The address of the recipient
6060
/// @param _amount The amount of tokens to be transferred
6161
/// @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);
6363

6464
/// @notice `msg.sender` approves `_spender` to spend `_amount` tokens on
6565
/// its behalf
6666
/// @param _spender The address of the account able to transfer the tokens
6767
/// @param _amount The amount of tokens to be approved for transfer
6868
/// @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);
7070

7171
/// @param _owner The address of the account owning tokens
7272
/// @param _spender The address of the account able to transfer the tokens
@@ -75,7 +75,7 @@ contract TokenInterface {
7575
function allowance(
7676
address _owner,
7777
address _spender
78-
) constant returns (uint256 remaining);
78+
) public constant returns (uint256 remaining);
7979

8080
event Transfer(address indexed _from, address indexed _to, uint256 _amount);
8181
event Approval(
@@ -86,19 +86,19 @@ contract TokenInterface {
8686
}
8787

8888
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;
9090
}
9191

9292
contract Token is TokenInterface {
9393
// Protects users by preventing the execution of method calls that
9494
// inadvertently also transferred ether
9595
modifier noEther() {if (msg.value > 0) revert(); _; }
9696

97-
function balanceOf(address _owner) constant returns (uint256 balance) {
97+
function balanceOf(address _owner) public constant returns (uint256 balance) {
9898
return balances[_owner];
9999
}
100100

101-
function transfer(address _to, uint256 _amount) noEther returns (bool success) {
101+
function transfer(address _to, uint256 _amount) noEther public returns (bool success) {
102102
if (balances[msg.sender] >= _amount && _amount > 0) {
103103
balances[msg.sender] -= _amount;
104104
balances[_to] += _amount;
@@ -113,7 +113,7 @@ contract Token is TokenInterface {
113113
address _from,
114114
address _to,
115115
uint256 _amount
116-
) noEther returns (bool success) {
116+
) noEther public returns (bool success) {
117117

118118
if (balances[_from] >= _amount
119119
&& allowed[_from][msg.sender] >= _amount
@@ -129,22 +129,22 @@ contract Token is TokenInterface {
129129
}
130130
}
131131

132-
function approve(address _spender, uint256 _amount) returns (bool success) {
132+
function approve(address _spender, uint256 _amount) public returns (bool success) {
133133
allowed[msg.sender][_spender] = _amount;
134134
Approval(msg.sender, _spender, _amount);
135135
return true;
136136
}
137137

138138
/// Allow another contract to spend some tokens in your behalf
139139
function approveAndCall(address _spender, uint256 _value, bytes _extraData)
140-
returns (bool success) {
140+
public returns (bool success) {
141141
allowed[msg.sender][_spender] = _value;
142142
tokenRecipient spender = tokenRecipient(_spender);
143143
spender.receiveApproval(msg.sender, _value, this, _extraData);
144144
return true;
145145
}
146146

147-
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
147+
function allowance(address _owner, address _spender) public constant returns (uint256 remaining) {
148148
return allowed[_owner][_spender];
149149
}
150150
}

0 commit comments

Comments
 (0)