Skip to content

Commit

Permalink
Merge pull request #235 from bit-shift/visibilitySpecifier
Browse files Browse the repository at this point in the history
Adds visibility specifier in compilation tests
  • Loading branch information
axic authored Jul 11, 2018
2 parents c6469a2 + f79baa2 commit 1bd7e1d
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 53 deletions.
76 changes: 38 additions & 38 deletions test/DAO/DAO.sol
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ contract DAOInterface {
/// to the DAO, it can also be used to receive payments that should not be
/// counted as rewards (donations, grants, etc.)
/// @return Whether the DAO received the ether successfully
function receiveEther() returns(bool);
function receiveEther() public returns (bool);

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

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

/// @notice Vote on proposal `_proposalID` with `_supportsProposal`
/// @param _proposalID The proposal ID
Expand All @@ -230,7 +230,7 @@ contract DAOInterface {
function vote(
uint _proposalID,
bool _supportsProposal
) onlyTokenholders returns (uint _voteID);
) onlyTokenholders public returns (uint _voteID);

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

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

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


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

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

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

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

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

/// @return total number of proposals ever created
function numberOfProposals() view returns (uint _numberOfProposals);
function numberOfProposals() public view returns (uint _numberOfProposals);

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

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

event ProposalAdded(
uint indexed proposalID,
Expand Down Expand Up @@ -368,12 +368,12 @@ contract DAO is DAOInterface, Token, TokenCreation {
string memory _tokenSymbol,
uint8 _decimalPlaces
) TokenCreation(
_minTokensToCreate,
_closingTime,
_privateCreation,
_tokenName,
_minTokensToCreate,
_closingTime,
_privateCreation,
_tokenName,
_tokenSymbol,
_decimalPlaces) {
_decimalPlaces) public {

curator = _curator;
daoCreator = _daoCreator;
Expand All @@ -400,7 +400,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
}


function receiveEther() returns (bool) {
function receiveEther() public returns (bool) {
return true;
}

Expand All @@ -412,7 +412,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
bytes memory _transactionData,
uint _debatingPeriod,
bool _newCurator
) onlyTokenholders returns (uint _proposalID) {
) onlyTokenholders public returns (uint _proposalID) {

// Sanity check
if (_newCurator && (
Expand Down Expand Up @@ -482,7 +482,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
address _recipient,
uint _amount,
bytes memory _transactionData
) noEther view returns (bool _codeChecksOut) {
) noEther public view returns (bool _codeChecksOut) {
Proposal storage p = proposals[_proposalID];
return p.proposalHash == keccak256(abi.encodePacked(_recipient, _amount, _transactionData));
}
Expand All @@ -491,7 +491,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
function vote(
uint _proposalID,
bool _supportsProposal
) onlyTokenholders noEther returns (uint _voteID) {
) onlyTokenholders noEther public returns (uint _voteID) {

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

Proposal storage p = proposals[_proposalID];

Expand Down Expand Up @@ -624,7 +624,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
function splitDAO(
uint _proposalID,
address _newCurator
) noEther onlyTokenholders returns (bool _success) {
) noEther onlyTokenholders public returns (bool _success) {

Proposal storage p = proposals[_proposalID];

Expand Down Expand Up @@ -696,7 +696,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
return true;
}

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

function getMyReward() noEther returns (bool _success) {
function getMyReward() noEther public returns (bool _success) {
return withdrawRewardFor(msg.sender);
}

Expand All @@ -757,7 +757,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
}


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


function transferWithoutReward(address _to, uint256 _value) returns (bool success) {
function transferWithoutReward(address _to, uint256 _value) public returns (bool success) {
if (!getMyReward())
revert();
return transfer(_to, _value);
}


function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
if (isFueled
&& now > closingTime
&& !isBlocked(_from)
Expand All @@ -798,7 +798,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
address _from,
address _to,
uint256 _value
) returns (bool success) {
) public returns (bool success) {

if (!withdrawRewardFor(_from))
revert();
Expand Down Expand Up @@ -851,7 +851,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
return false;
}

function actualBalance() view returns (uint _actualBalance) {
function actualBalance() public view returns (uint _actualBalance) {
return this.balance - sumOfProposalDeposits;
}

Expand All @@ -863,7 +863,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
}


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

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

function getNewDAOAddress(uint _proposalID) view returns (address _newDAO) {
function getNewDAOAddress(uint _proposalID) public view returns (address _newDAO) {
return proposals[_proposalID].splitData[0].newDAO;
}

Expand All @@ -913,7 +913,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
}
}

function unblockMe() returns (bool) {
function unblockMe() public returns (bool) {
return isBlocked(msg.sender);
}
}
Expand All @@ -927,7 +927,7 @@ contract DAO_Creator {
string memory _tokenName,
string memory _tokenSymbol,
uint8 _decimalPlaces
) returns (DAO _newDAO) {
) public returns (DAO _newDAO) {

return new DAO(
_curator,
Expand All @@ -936,7 +936,7 @@ contract DAO_Creator {
_minTokensToCreate,
_closingTime,
msg.sender,
_tokenName,
_tokenName,
_tokenSymbol,
_decimalPlaces
);
Expand Down
14 changes: 7 additions & 7 deletions test/DAO/ManagedAccount.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ along with the DAO. If not, see <http://www.gnu.org/licenses/>.


/*
Basic account, used by the DAO contract to separately manage both the rewards
and the extraBalance accounts.
Basic account, used by the DAO contract to separately manage both the rewards
and the extraBalance accounts.
*/

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

event PayOut(address indexed _recipient, uint _amount);
}
Expand All @@ -42,19 +42,19 @@ contract ManagedAccountInterface {
contract ManagedAccount is ManagedAccountInterface{

// The constructor sets the owner of the account
constructor(address _owner, bool _payOwnerOnly) {
constructor(address _owner, bool _payOwnerOnly) public {
owner = _owner;
payOwnerOnly = _payOwnerOnly;
}

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

function payOut(address _recipient, uint _amount) returns (bool) {
function payOut(address _recipient, uint _amount) public returns (bool) {
if (msg.sender != owner || msg.value > 0 || (payOwnerOnly && _recipient != owner))
revert();
if (_recipient.call.value(_amount)("")) {
Expand Down
16 changes: 8 additions & 8 deletions test/DAO/TokenCreation.sol
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ contract TokenCreationInterface {
/// @notice Create Token with `_tokenHolder` as the initial owner of the Token
/// @param _tokenHolder The address of the Tokens's recipient
/// @return Whether the token creation was successful
function createTokenProxy(address _tokenHolder) payable returns (bool success);
function createTokenProxy(address _tokenHolder) payable public returns (bool success);

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

/// @return The divisor used to calculate the token creation rate during
/// the creation phase
function divisor() view returns (uint divisor);
function divisor() public view returns (uint divisor);

event FuelingToDate(uint value);
event CreatedToken(address indexed to, uint amount);
Expand All @@ -88,7 +88,7 @@ contract TokenCreation is TokenCreationInterface, Token {
address _privateCreation,
string memory _tokenName,
string memory _tokenSymbol,
uint8 _decimalPlaces) {
uint8 _decimalPlaces) public {

closingTime = _closingTime;
minTokensToCreate = _minTokensToCreate;
Expand All @@ -97,10 +97,10 @@ contract TokenCreation is TokenCreationInterface, Token {
name = _tokenName;
symbol = _tokenSymbol;
decimals = _decimalPlaces;

}

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

Expand All @@ -119,7 +119,7 @@ contract TokenCreation is TokenCreationInterface, Token {
revert();
}

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

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

0 comments on commit 1bd7e1d

Please sign in to comment.