Skip to content

Commit 1bd7e1d

Browse files
authored
Merge pull request #235 from bit-shift/visibilitySpecifier
Adds visibility specifier in compilation tests
2 parents c6469a2 + f79baa2 commit 1bd7e1d

File tree

3 files changed

+53
-53
lines changed

3 files changed

+53
-53
lines changed

test/DAO/DAO.sol

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ contract DAOInterface {
184184
/// to the DAO, it can also be used to receive payments that should not be
185185
/// counted as rewards (donations, grants, etc.)
186186
/// @return Whether the DAO received the ether successfully
187-
function receiveEther() returns(bool);
187+
function receiveEther() public returns (bool);
188188

189189
/// @notice `msg.sender` creates a proposal to send `_amount` Wei to
190190
/// `_recipient` with the transaction data `_transactionData`. If
@@ -206,7 +206,7 @@ contract DAOInterface {
206206
bytes memory _transactionData,
207207
uint _debatingPeriod,
208208
bool _newCurator
209-
) onlyTokenholders returns (uint _proposalID);
209+
) onlyTokenholders public returns (uint _proposalID);
210210

211211
/// @notice Check that the proposal with the ID `_proposalID` matches the
212212
/// transaction which sends `_amount` with data `_transactionData`
@@ -221,7 +221,7 @@ contract DAOInterface {
221221
address _recipient,
222222
uint _amount,
223223
bytes memory _transactionData
224-
) view returns (bool _codeChecksOut);
224+
) public view returns (bool _codeChecksOut);
225225

226226
/// @notice Vote on proposal `_proposalID` with `_supportsProposal`
227227
/// @param _proposalID The proposal ID
@@ -230,7 +230,7 @@ contract DAOInterface {
230230
function vote(
231231
uint _proposalID,
232232
bool _supportsProposal
233-
) onlyTokenholders returns (uint _voteID);
233+
) onlyTokenholders public returns (uint _voteID);
234234

235235
/// @notice Checks whether proposal `_proposalID` with transaction data
236236
/// `_transactionData` has been voted for or rejected, and executes the
@@ -241,7 +241,7 @@ contract DAOInterface {
241241
function executeProposal(
242242
uint _proposalID,
243243
bytes memory _transactionData
244-
) returns (bool _success);
244+
) public returns (bool _success);
245245

246246
/// @notice ATTENTION! I confirm to move my remaining ether to a new DAO
247247
/// with `_newCurator` as the new Curator, as has been
@@ -257,13 +257,13 @@ contract DAOInterface {
257257
function splitDAO(
258258
uint _proposalID,
259259
address _newCurator
260-
) returns (bool _success);
260+
) public returns (bool _success);
261261

262262
/// @dev can only be called by the DAO itself through a proposal
263263
/// updates the contract of the DAO by sending all ether and rewardTokens
264264
/// to the new DAO. The new DAO needs to be approved by the Curator
265265
/// @param _newContract the address of the new contract
266-
function newContract(address _newContract);
266+
function newContract(address _newContract) public;
267267

268268

269269
/// @notice Add a new possible recipient `_recipient` to the whitelist so
@@ -288,7 +288,7 @@ contract DAOInterface {
288288

289289
/// @notice Get my portion of the reward that was sent to `rewardAccount`
290290
/// @return Whether the call was successful
291-
function getMyReward() returns(bool _success);
291+
function getMyReward() public returns (bool _success);
292292

293293
/// @notice Withdraw `_account`'s portion of the reward from `rewardAccount`
294294
/// to `_account`'s balance
@@ -300,7 +300,7 @@ contract DAOInterface {
300300
/// @param _to The address of the recipient
301301
/// @param _amount The amount of tokens to be transfered
302302
/// @return Whether the transfer was successful or not
303-
function transferWithoutReward(address _to, uint256 _amount) returns (bool success);
303+
function transferWithoutReward(address _to, uint256 _amount) public returns (bool success);
304304

305305
/// @notice Send `_amount` tokens to `_to` from `_from` on the condition it
306306
/// is approved by `_from`. Prior to this getMyReward() is called.
@@ -312,19 +312,19 @@ contract DAOInterface {
312312
address _from,
313313
address _to,
314314
uint256 _amount
315-
) returns (bool success);
315+
) public returns (bool success);
316316

317317
/// @notice Doubles the 'minQuorumDivisor' in the case quorum has not been
318318
/// achieved in 52 weeks
319319
/// @return Whether the change was successful or not
320-
function halveMinQuorum() returns (bool _success);
320+
function halveMinQuorum() public returns (bool _success);
321321

322322
/// @return total number of proposals ever created
323-
function numberOfProposals() view returns (uint _numberOfProposals);
323+
function numberOfProposals() public view returns (uint _numberOfProposals);
324324

325325
/// @param _proposalID Id of the new curator proposal
326326
/// @return Address of the new DAO
327-
function getNewDAOAddress(uint _proposalID) view returns (address _newDAO);
327+
function getNewDAOAddress(uint _proposalID) public view returns (address _newDAO);
328328

329329
/// @param _account The address of the account which is checked.
330330
/// @return Whether the account is blocked (not allowed to transfer tokens) or not.
@@ -333,7 +333,7 @@ contract DAOInterface {
333333
/// @notice If the caller is blocked by a proposal whose voting deadline
334334
/// has exprired then unblock him.
335335
/// @return Whether the account is blocked (not allowed to transfer tokens) or not.
336-
function unblockMe() returns (bool);
336+
function unblockMe() public returns (bool);
337337

338338
event ProposalAdded(
339339
uint indexed proposalID,
@@ -368,12 +368,12 @@ contract DAO is DAOInterface, Token, TokenCreation {
368368
string memory _tokenSymbol,
369369
uint8 _decimalPlaces
370370
) TokenCreation(
371-
_minTokensToCreate,
372-
_closingTime,
373-
_privateCreation,
374-
_tokenName,
371+
_minTokensToCreate,
372+
_closingTime,
373+
_privateCreation,
374+
_tokenName,
375375
_tokenSymbol,
376-
_decimalPlaces) {
376+
_decimalPlaces) public {
377377

378378
curator = _curator;
379379
daoCreator = _daoCreator;
@@ -400,7 +400,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
400400
}
401401

402402

403-
function receiveEther() returns (bool) {
403+
function receiveEther() public returns (bool) {
404404
return true;
405405
}
406406

@@ -412,7 +412,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
412412
bytes memory _transactionData,
413413
uint _debatingPeriod,
414414
bool _newCurator
415-
) onlyTokenholders returns (uint _proposalID) {
415+
) onlyTokenholders public returns (uint _proposalID) {
416416

417417
// Sanity check
418418
if (_newCurator && (
@@ -482,7 +482,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
482482
address _recipient,
483483
uint _amount,
484484
bytes memory _transactionData
485-
) noEther view returns (bool _codeChecksOut) {
485+
) noEther public view returns (bool _codeChecksOut) {
486486
Proposal storage p = proposals[_proposalID];
487487
return p.proposalHash == keccak256(abi.encodePacked(_recipient, _amount, _transactionData));
488488
}
@@ -491,7 +491,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
491491
function vote(
492492
uint _proposalID,
493493
bool _supportsProposal
494-
) onlyTokenholders noEther returns (uint _voteID) {
494+
) onlyTokenholders noEther public returns (uint _voteID) {
495495

496496
Proposal storage p = proposals[_proposalID];
497497
if (p.votedYes[msg.sender]
@@ -524,7 +524,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
524524
function executeProposal(
525525
uint _proposalID,
526526
bytes memory _transactionData
527-
) noEther returns (bool _success) {
527+
) noEther public returns (bool _success) {
528528

529529
Proposal storage p = proposals[_proposalID];
530530

@@ -624,7 +624,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
624624
function splitDAO(
625625
uint _proposalID,
626626
address _newCurator
627-
) noEther onlyTokenholders returns (bool _success) {
627+
) noEther onlyTokenholders public returns (bool _success) {
628628

629629
Proposal storage p = proposals[_proposalID];
630630

@@ -696,7 +696,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
696696
return true;
697697
}
698698

699-
function newContract(address _newContract){
699+
function newContract(address _newContract) public {
700700
if (msg.sender != address(this) || !allowedRecipients[_newContract]) return;
701701
// move all ether
702702
if (!_newContract.call.value(address(this).balance)("")) {
@@ -736,7 +736,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
736736
return true;
737737
}
738738

739-
function getMyReward() noEther returns (bool _success) {
739+
function getMyReward() noEther public returns (bool _success) {
740740
return withdrawRewardFor(msg.sender);
741741
}
742742

@@ -757,7 +757,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
757757
}
758758

759759

760-
function transfer(address _to, uint256 _value) returns (bool success) {
760+
function transfer(address _to, uint256 _value) public returns (bool success) {
761761
if (isFueled
762762
&& now > closingTime
763763
&& !isBlocked(msg.sender)
@@ -772,14 +772,14 @@ contract DAO is DAOInterface, Token, TokenCreation {
772772
}
773773

774774

775-
function transferWithoutReward(address _to, uint256 _value) returns (bool success) {
775+
function transferWithoutReward(address _to, uint256 _value) public returns (bool success) {
776776
if (!getMyReward())
777777
revert();
778778
return transfer(_to, _value);
779779
}
780780

781781

782-
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
782+
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
783783
if (isFueled
784784
&& now > closingTime
785785
&& !isBlocked(_from)
@@ -798,7 +798,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
798798
address _from,
799799
address _to,
800800
uint256 _value
801-
) returns (bool success) {
801+
) public returns (bool success) {
802802

803803
if (!withdrawRewardFor(_from))
804804
revert();
@@ -851,7 +851,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
851851
return false;
852852
}
853853

854-
function actualBalance() view returns (uint _actualBalance) {
854+
function actualBalance() public view returns (uint _actualBalance) {
855855
return this.balance - sumOfProposalDeposits;
856856
}
857857

@@ -863,7 +863,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
863863
}
864864

865865

866-
function halveMinQuorum() returns (bool _success) {
866+
function halveMinQuorum() public returns (bool _success) {
867867
// this can only be called after `quorumHalvingPeriod` has passed or at anytime after
868868
// fueling by the curator with a delay of at least `minProposalDebatePeriod`
869869
// between the calls
@@ -892,12 +892,12 @@ contract DAO is DAOInterface, Token, TokenCreation {
892892
);
893893
}
894894

895-
function numberOfProposals() view returns (uint _numberOfProposals) {
895+
function numberOfProposals() public view returns (uint _numberOfProposals) {
896896
// Don't count index 0. It's used by isBlocked() and exists from start
897897
return proposals.length - 1;
898898
}
899899

900-
function getNewDAOAddress(uint _proposalID) view returns (address _newDAO) {
900+
function getNewDAOAddress(uint _proposalID) public view returns (address _newDAO) {
901901
return proposals[_proposalID].splitData[0].newDAO;
902902
}
903903

@@ -913,7 +913,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
913913
}
914914
}
915915

916-
function unblockMe() returns (bool) {
916+
function unblockMe() public returns (bool) {
917917
return isBlocked(msg.sender);
918918
}
919919
}
@@ -927,7 +927,7 @@ contract DAO_Creator {
927927
string memory _tokenName,
928928
string memory _tokenSymbol,
929929
uint8 _decimalPlaces
930-
) returns (DAO _newDAO) {
930+
) public returns (DAO _newDAO) {
931931

932932
return new DAO(
933933
_curator,
@@ -936,7 +936,7 @@ contract DAO_Creator {
936936
_minTokensToCreate,
937937
_closingTime,
938938
msg.sender,
939-
_tokenName,
939+
_tokenName,
940940
_tokenSymbol,
941941
_decimalPlaces
942942
);

test/DAO/ManagedAccount.sol

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ along with the DAO. If not, see <http://www.gnu.org/licenses/>.
1717

1818

1919
/*
20-
Basic account, used by the DAO contract to separately manage both the rewards
21-
and the extraBalance accounts.
20+
Basic account, used by the DAO contract to separately manage both the rewards
21+
and the extraBalance accounts.
2222
*/
2323

2424
contract ManagedAccountInterface {
@@ -33,7 +33,7 @@ contract ManagedAccountInterface {
3333
/// @param _amount The amount of wei to send to `_recipient`
3434
/// @param _recipient The address to receive `_amount` of wei
3535
/// @return True if the send completed
36-
function payOut(address _recipient, uint _amount) returns (bool);
36+
function payOut(address _recipient, uint _amount) public returns (bool);
3737

3838
event PayOut(address indexed _recipient, uint _amount);
3939
}
@@ -42,19 +42,19 @@ contract ManagedAccountInterface {
4242
contract ManagedAccount is ManagedAccountInterface{
4343

4444
// The constructor sets the owner of the account
45-
constructor(address _owner, bool _payOwnerOnly) {
45+
constructor(address _owner, bool _payOwnerOnly) public {
4646
owner = _owner;
4747
payOwnerOnly = _payOwnerOnly;
4848
}
4949

50-
// When the contract receives a transaction without data this is called.
51-
// It counts the amount of ether it receives and stores it in
50+
// When the contract receives a transaction without data this is called.
51+
// It counts the amount of ether it receives and stores it in
5252
// accumulatedInput.
5353
function() external {
5454
accumulatedInput += msg.value;
5555
}
5656

57-
function payOut(address _recipient, uint _amount) returns (bool) {
57+
function payOut(address _recipient, uint _amount) public returns (bool) {
5858
if (msg.sender != owner || msg.value > 0 || (payOwnerOnly && _recipient != owner))
5959
revert();
6060
if (_recipient.call.value(_amount)("")) {

test/DAO/TokenCreation.sol

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ contract TokenCreationInterface {
6565
/// @notice Create Token with `_tokenHolder` as the initial owner of the Token
6666
/// @param _tokenHolder The address of the Tokens's recipient
6767
/// @return Whether the token creation was successful
68-
function createTokenProxy(address _tokenHolder) payable returns (bool success);
68+
function createTokenProxy(address _tokenHolder) payable public returns (bool success);
6969

7070
/// @notice Refund `msg.sender` in the case the Token Creation did
7171
/// not reach its minimum fueling goal
72-
function refund();
72+
function refund() public;
7373

7474
/// @return The divisor used to calculate the token creation rate during
7575
/// the creation phase
76-
function divisor() view returns (uint divisor);
76+
function divisor() public view returns (uint divisor);
7777

7878
event FuelingToDate(uint value);
7979
event CreatedToken(address indexed to, uint amount);
@@ -88,7 +88,7 @@ contract TokenCreation is TokenCreationInterface, Token {
8888
address _privateCreation,
8989
string memory _tokenName,
9090
string memory _tokenSymbol,
91-
uint8 _decimalPlaces) {
91+
uint8 _decimalPlaces) public {
9292

9393
closingTime = _closingTime;
9494
minTokensToCreate = _minTokensToCreate;
@@ -97,10 +97,10 @@ contract TokenCreation is TokenCreationInterface, Token {
9797
name = _tokenName;
9898
symbol = _tokenSymbol;
9999
decimals = _decimalPlaces;
100-
100+
101101
}
102102

103-
function createTokenProxy(address _tokenHolder) payable returns (bool success) {
103+
function createTokenProxy(address _tokenHolder) payable public returns (bool success) {
104104
if (now < closingTime && msg.value > 0
105105
&& (privateCreation == 0x0000000000000000000000000000000000000000 || privateCreation == msg.sender)) {
106106

@@ -119,7 +119,7 @@ contract TokenCreation is TokenCreationInterface, Token {
119119
revert();
120120
}
121121

122-
function refund() noEther {
122+
function refund() noEther public {
123123
if (now > closingTime && !isFueled) {
124124
// Get extraBalance - will only succeed when called for the first time
125125
if (extraBalance.balance >= extraBalance.accumulatedInput())
@@ -135,7 +135,7 @@ contract TokenCreation is TokenCreationInterface, Token {
135135
}
136136
}
137137

138-
function divisor() view returns (uint divisor) {
138+
function divisor() public view returns (uint divisor) {
139139
// The number of (base unit) tokens per wei is calculated
140140
// as `msg.value` * 20 / `divisor`
141141
// The fueling period starts with a 1:1 ratio

0 commit comments

Comments
 (0)