mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Update compilation tests.
This commit is contained in:
@@ -81,7 +81,7 @@ contract ico is safeMath {
|
||||
}
|
||||
}
|
||||
|
||||
function ICObonus() public constant returns(uint256 bonus) {
|
||||
function ICObonus() public view returns(uint256 bonus) {
|
||||
/*
|
||||
Query of current bonus
|
||||
|
||||
@@ -113,7 +113,7 @@ contract ico is safeMath {
|
||||
return true;
|
||||
}
|
||||
|
||||
function checkInterest(address addr) public constant returns(uint256 amount) {
|
||||
function checkInterest(address addr) public view returns(uint256 amount) {
|
||||
/*
|
||||
Query of compound interest
|
||||
|
||||
@@ -355,7 +355,7 @@ contract ico is safeMath {
|
||||
}
|
||||
}
|
||||
|
||||
function getIcoReward(uint256 value) public constant returns (uint256 reward) {
|
||||
function getIcoReward(uint256 value) public view returns (uint256 reward) {
|
||||
/*
|
||||
Expected token volume at token purchase
|
||||
|
||||
@@ -368,7 +368,7 @@ contract ico is safeMath {
|
||||
if ( reward < 5e6) { return 0; }
|
||||
}
|
||||
|
||||
function isICO() public constant returns (bool success) {
|
||||
function isICO() public view returns (bool success) {
|
||||
return startBlock <= block.number && block.number <= icoDelay && ( ! aborted ) && ( ! closed );
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ pragma solidity ^0.4.11;
|
||||
|
||||
contract abstractModuleHandler {
|
||||
function transfer(address from, address to, uint256 value, bool fee) external returns (bool success) {}
|
||||
function balanceOf(address owner) public constant returns (bool success, uint256 value) {}
|
||||
function balanceOf(address owner) public view returns (bool success, uint256 value) {}
|
||||
}
|
||||
|
||||
contract module {
|
||||
@@ -127,7 +127,7 @@ contract module {
|
||||
if ( moduleStatus != status.Connected ) { return false; }
|
||||
return addr == moduleHandlerAddress;
|
||||
}
|
||||
function isActive() public constant returns (bool success, bool active) {
|
||||
function isActive() public view returns (bool success, bool active) {
|
||||
/*
|
||||
Check self for ready for functions or not.
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ contract abstractModule {
|
||||
function disconnectModule() external returns (bool success) {}
|
||||
function replaceModule(address addr) external returns (bool success) {}
|
||||
function disableModule(bool forever) external returns (bool success) {}
|
||||
function isActive() public constant returns (bool success) {}
|
||||
function isActive() public view returns (bool success) {}
|
||||
function replaceModuleHandler(address newHandler) external returns (bool success) {}
|
||||
function transferEvent(address from, address to, uint256 value) external returns (bool success) {}
|
||||
function newSchellingRoundEvent(uint256 roundID, uint256 reward) external returns (bool success) {}
|
||||
@@ -81,7 +81,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
||||
}
|
||||
modules[id] = input;
|
||||
}
|
||||
function getModuleAddressByName(string name) public constant returns( bool success, bool found, address addr ) {
|
||||
function getModuleAddressByName(string name) public view returns( bool success, bool found, address addr ) {
|
||||
/*
|
||||
Search by name for module. The result is an Ethereum address.
|
||||
|
||||
@@ -94,7 +94,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
||||
if ( _success && _found ) { return (true, true, modules[_id].addr); }
|
||||
return (true, false, address(0x00));
|
||||
}
|
||||
function getModuleIDByHash(bytes32 hashOfName) public constant returns( bool success, bool found, uint256 id ) {
|
||||
function getModuleIDByHash(bytes32 hashOfName) public view returns( bool success, bool found, uint256 id ) {
|
||||
/*
|
||||
Search by hash of name in the module array. The result is an index array.
|
||||
|
||||
@@ -109,7 +109,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
||||
}
|
||||
return (true, false, 0);
|
||||
}
|
||||
function getModuleIDByName(string name) public constant returns( bool success, bool found, uint256 id ) {
|
||||
function getModuleIDByName(string name) public view returns( bool success, bool found, uint256 id ) {
|
||||
/*
|
||||
Search by name for module. The result is an index array.
|
||||
|
||||
@@ -125,7 +125,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
||||
}
|
||||
return (true, false, 0);
|
||||
}
|
||||
function getModuleIDByAddress(address addr) public constant returns( bool success, bool found, uint256 id ) {
|
||||
function getModuleIDByAddress(address addr) public view returns( bool success, bool found, uint256 id ) {
|
||||
/*
|
||||
Search by ethereum address for module. The result is an index array.
|
||||
|
||||
@@ -298,7 +298,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function balanceOf(address owner) public constant returns (bool success, uint256 value) {
|
||||
function balanceOf(address owner) public view returns (bool success, uint256 value) {
|
||||
/*
|
||||
Query of token balance.
|
||||
|
||||
@@ -310,7 +310,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
||||
require( _success && _found );
|
||||
return (true, token(modules[_id].addr).balanceOf(owner));
|
||||
}
|
||||
function totalSupply() public constant returns (bool success, uint256 value) {
|
||||
function totalSupply() public view returns (bool success, uint256 value) {
|
||||
/*
|
||||
Query of the whole token amount.
|
||||
|
||||
@@ -321,7 +321,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
||||
require( _success && _found );
|
||||
return (true, token(modules[_id].addr).totalSupply());
|
||||
}
|
||||
function isICO() public constant returns (bool success, bool ico) {
|
||||
function isICO() public view returns (bool success, bool ico) {
|
||||
/*
|
||||
Query of ICO state
|
||||
|
||||
@@ -332,7 +332,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
||||
require( _success && _found );
|
||||
return (true, token(modules[_id].addr).isICO());
|
||||
}
|
||||
function getCurrentSchellingRoundID() public constant returns (bool success, uint256 round) {
|
||||
function getCurrentSchellingRoundID() public view returns (bool success, uint256 round) {
|
||||
/*
|
||||
Query of number of the actual Schelling round.
|
||||
|
||||
|
||||
@@ -38,13 +38,13 @@ contract multiOwner is safeMath {
|
||||
/*
|
||||
Constants
|
||||
*/
|
||||
function ownersForChange() public constant returns (uint256 owners) {
|
||||
function ownersForChange() public view returns (uint256 owners) {
|
||||
return ownerCount * 75 / 100;
|
||||
}
|
||||
function calcDoHash(string job, bytes32 data) public constant returns (bytes32 hash) {
|
||||
function calcDoHash(string job, bytes32 data) public pure returns (bytes32 hash) {
|
||||
return keccak256(abi.encodePacked(job, data));
|
||||
}
|
||||
function validDoHash(bytes32 doHash) public constant returns (bool valid) {
|
||||
function validDoHash(bytes32 doHash) public view returns (bool valid) {
|
||||
return doDB[doHash].length > 0;
|
||||
}
|
||||
/*
|
||||
|
||||
@@ -140,7 +140,7 @@ contract premium is module, safeMath {
|
||||
emit Approval(msg.sender, spender, amount);
|
||||
}
|
||||
|
||||
function allowance(address owner, address spender) constant returns (uint256 remaining, uint256 nonce) {
|
||||
function allowance(address owner, address spender) view returns (uint256 remaining, uint256 nonce) {
|
||||
/*
|
||||
Get the quantity of tokens given to be used
|
||||
|
||||
@@ -319,7 +319,7 @@ contract premium is module, safeMath {
|
||||
return _codeLength > 0;
|
||||
}
|
||||
|
||||
function balanceOf(address owner) constant returns (uint256 value) {
|
||||
function balanceOf(address owner) view returns (uint256 value) {
|
||||
/*
|
||||
Token balance query
|
||||
|
||||
@@ -329,7 +329,7 @@ contract premium is module, safeMath {
|
||||
return db.balanceOf(owner);
|
||||
}
|
||||
|
||||
function totalSupply() constant returns (uint256 value) {
|
||||
function totalSupply() view returns (uint256 value) {
|
||||
/*
|
||||
Total token quantity query
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ contract provider is module, safeMath, announcementTypes {
|
||||
else { return false; }
|
||||
return true;
|
||||
}
|
||||
function getUserDetails(address addr, uint256 schellingRound) public constant returns (address ProviderAddress, uint256 ProviderHeight, uint256 ConnectedOn, uint256 value) {
|
||||
function getUserDetails(address addr, uint256 schellingRound) public view returns (address ProviderAddress, uint256 ProviderHeight, uint256 ConnectedOn, uint256 value) {
|
||||
/*
|
||||
Collecting the datas of the client.
|
||||
|
||||
@@ -168,7 +168,7 @@ contract provider is module, safeMath, announcementTypes {
|
||||
value = clients[addr].supply[schellingRound];
|
||||
}
|
||||
}
|
||||
function rightForInterest(uint256 value, bool priv) internal returns (bool) {
|
||||
function rightForInterest(uint256 value, bool priv) internal view returns (bool) {
|
||||
/*
|
||||
the share from the token emission.
|
||||
In case is a private provider it has to be checked if it has enough connected capital to be able to accept share from the token emission.
|
||||
@@ -299,7 +299,7 @@ contract provider is module, safeMath, announcementTypes {
|
||||
providers[addr].data[currHeight].currentRate = rate;
|
||||
emit EProviderDetailsChanged(addr, currHeight, website, country, info, rate, admin);
|
||||
}
|
||||
function getProviderInfo(address addr, uint256 height) public constant returns (string name, string website, string country, string info, uint256 create) {
|
||||
function getProviderInfo(address addr, uint256 height) public view returns (string name, string website, string country, string info, uint256 create) {
|
||||
/*
|
||||
for the infos of the provider.
|
||||
In case the height is unknown then the system will use the last known height.
|
||||
@@ -321,7 +321,7 @@ contract provider is module, safeMath, announcementTypes {
|
||||
info = providers[addr].data[height].info;
|
||||
create = providers[addr].data[height].create;
|
||||
}
|
||||
function getProviderDetails(address addr, uint256 height) public constant returns (uint8 rate, bool isForRent, uint256 clientsCount, bool priv, bool getInterest, bool valid) {
|
||||
function getProviderDetails(address addr, uint256 height) public view returns (uint8 rate, bool isForRent, uint256 clientsCount, bool priv, bool getInterest, bool valid) {
|
||||
/*
|
||||
Asking for the datas of the provider.
|
||||
In case the height is unknown then the system will use the last known height.
|
||||
@@ -345,7 +345,7 @@ contract provider is module, safeMath, announcementTypes {
|
||||
getInterest = rightForInterest(getProviderCurrentSupply(addr), providers[addr].data[height].priv );
|
||||
valid = providers[addr].data[height].valid;
|
||||
}
|
||||
function getProviderCurrentSupply(address addr) internal returns (uint256) {
|
||||
function getProviderCurrentSupply(address addr) internal view returns (uint256) {
|
||||
/*
|
||||
Inner function for polling the current height and the current quantity of the connected capital of the schelling round.
|
||||
|
||||
@@ -469,7 +469,7 @@ contract provider is module, safeMath, announcementTypes {
|
||||
delete clients[msg.sender].providerConnected;
|
||||
emit EClientLost(msg.sender, provider, currHeight, bal);
|
||||
}
|
||||
function checkReward(address addr) public constant returns (uint256 reward) {
|
||||
function checkReward(address addr) public returns (uint256 reward) {
|
||||
/*
|
||||
Polling the share from the token emission for clients and for providers.
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ contract publisher is announcementTypes, module, safeMath {
|
||||
super.registerModuleHandler(moduleHandler);
|
||||
}
|
||||
|
||||
function Announcements(uint256 id) public constant returns (uint256 Type, uint256 Start, uint256 End, bool Closed, string Announcement, string Link, bool Opposited, string _str, uint256 _uint, address _addr) {
|
||||
function Announcements(uint256 id) public view returns (uint256 Type, uint256 Start, uint256 End, bool Closed, string Announcement, string Link, bool Opposited, string _str, uint256 _uint, address _addr) {
|
||||
/*
|
||||
Announcement data query
|
||||
|
||||
@@ -101,7 +101,7 @@ contract publisher is announcementTypes, module, safeMath {
|
||||
_addr = announcements[id]._addr;
|
||||
}
|
||||
|
||||
function checkOpposited(uint256 weight, bool oppositable) public constant returns (bool success) {
|
||||
function checkOpposited(uint256 weight, bool oppositable) public view returns (bool success) {
|
||||
/*
|
||||
Veto check
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ contract schellingDB is safeMath, schellingVars {
|
||||
Funds
|
||||
*/
|
||||
mapping(address => uint256) private funds;
|
||||
function getFunds(address _owner) constant returns(bool, uint256) {
|
||||
function getFunds(address _owner) view returns(bool, uint256) {
|
||||
return (true, funds[_owner]);
|
||||
}
|
||||
function setFunds(address _owner, uint256 _amount) isOwner external returns(bool) {
|
||||
@@ -65,7 +65,7 @@ contract schellingDB is safeMath, schellingVars {
|
||||
Rounds
|
||||
*/
|
||||
_rounds[] private rounds;
|
||||
function getRound(uint256 _id) constant returns(bool, uint256, uint256, uint256, uint256, bool) {
|
||||
function getRound(uint256 _id) view returns(bool, uint256, uint256, uint256, uint256, bool) {
|
||||
if ( rounds.length <= _id ) { return (false, 0, 0, 0, 0, false); }
|
||||
else { return (true, rounds[_id].totalAboveWeight, rounds[_id].totalBelowWeight, rounds[_id].reward, rounds[_id].blockHeight, rounds[_id].voted); }
|
||||
}
|
||||
@@ -76,14 +76,14 @@ contract schellingDB is safeMath, schellingVars {
|
||||
rounds[_id] = _rounds(_totalAboveWeight, _totalBelowWeight, _reward, _blockHeight, _voted);
|
||||
return true;
|
||||
}
|
||||
function getCurrentRound() constant returns(bool, uint256) {
|
||||
function getCurrentRound() view returns(bool, uint256) {
|
||||
return (true, rounds.length-1);
|
||||
}
|
||||
/*
|
||||
Voter
|
||||
*/
|
||||
mapping(address => _voter) private voter;
|
||||
function getVoter(address _owner) constant returns(bool success, uint256 roundID,
|
||||
function getVoter(address _owner) view returns(bool success, uint256 roundID,
|
||||
bytes32 hash, voterStatus status, bool voteResult, uint256 rewards) {
|
||||
roundID = voter[_owner].roundID;
|
||||
hash = voter[_owner].hash;
|
||||
@@ -106,7 +106,7 @@ contract schellingDB is safeMath, schellingVars {
|
||||
Schelling Token emission
|
||||
*/
|
||||
mapping(uint256 => uint256) private schellingExpansion;
|
||||
function getSchellingExpansion(uint256 _id) constant returns(bool, uint256) {
|
||||
function getSchellingExpansion(uint256 _id) view returns(bool, uint256) {
|
||||
return (true, schellingExpansion[_id]);
|
||||
}
|
||||
function setSchellingExpansion(uint256 _id, uint256 _expansion) isOwner external returns(bool) {
|
||||
@@ -121,7 +121,7 @@ contract schellingDB is safeMath, schellingVars {
|
||||
currentSchellingRound = _id;
|
||||
return true;
|
||||
}
|
||||
function getCurrentSchellingRound() constant returns(bool, uint256) {
|
||||
function getCurrentSchellingRound() view returns(bool, uint256) {
|
||||
return (true, currentSchellingRound);
|
||||
}
|
||||
}
|
||||
@@ -183,7 +183,7 @@ contract schelling is module, announcementTypes, schellingVars {
|
||||
voter.rewards
|
||||
) );
|
||||
}
|
||||
function getVoter(address addr) internal returns (_voter) {
|
||||
function getVoter(address addr) internal view returns (_voter) {
|
||||
(bool a, uint256 b, bytes32 c, schellingVars.voterStatus d, bool e, uint256 f) = db.getVoter(addr);
|
||||
require( a );
|
||||
return _voter(b, c, d, e, f);
|
||||
@@ -221,7 +221,7 @@ contract schelling is module, announcementTypes, schellingVars {
|
||||
function setCurrentSchellingRound(uint256 id) internal {
|
||||
require( db.setCurrentSchellingRound(id) );
|
||||
}
|
||||
function getCurrentSchellingRound() internal returns(uint256) {
|
||||
function getCurrentSchellingRound() internal view returns(uint256) {
|
||||
(bool a, uint256 b) = db.getCurrentSchellingRound();
|
||||
require( a );
|
||||
return b;
|
||||
@@ -229,7 +229,7 @@ contract schelling is module, announcementTypes, schellingVars {
|
||||
function setSchellingExpansion(uint256 id, uint256 amount) internal {
|
||||
require( db.setSchellingExpansion(id, amount) );
|
||||
}
|
||||
function getSchellingExpansion(uint256 id) internal returns(uint256) {
|
||||
function getSchellingExpansion(uint256 id) internal view returns(uint256) {
|
||||
(bool a, uint256 b) = db.getSchellingExpansion(id);
|
||||
require( a );
|
||||
return b;
|
||||
@@ -417,7 +417,7 @@ contract schelling is module, announcementTypes, schellingVars {
|
||||
|
||||
setVoter(msg.sender, voter);
|
||||
}
|
||||
function checkReward() public constant returns (uint256 reward) {
|
||||
function checkReward() public view returns (uint256 reward) {
|
||||
/*
|
||||
Withdraw of the amount of the prize (it’s only information).
|
||||
|
||||
@@ -496,7 +496,7 @@ contract schelling is module, announcementTypes, schellingVars {
|
||||
|
||||
require( moduleHandler(moduleHandlerAddress).transfer(address(this), msg.sender, funds, true) );
|
||||
}
|
||||
function getCurrentSchellingRoundID() public constant returns (uint256) {
|
||||
function getCurrentSchellingRoundID() public view returns (uint256) {
|
||||
/*
|
||||
Number of actual Schelling round.
|
||||
|
||||
@@ -504,7 +504,7 @@ contract schelling is module, announcementTypes, schellingVars {
|
||||
*/
|
||||
return getCurrentSchellingRound();
|
||||
}
|
||||
function getSchellingRound(uint256 id) public constant returns (uint256 expansion) {
|
||||
function getSchellingRound(uint256 id) public view returns (uint256 expansion) {
|
||||
/*
|
||||
Amount of token emission of the Schelling round.
|
||||
|
||||
|
||||
@@ -155,7 +155,7 @@ contract token is safeMath, module, announcementTypes {
|
||||
emit Approval(msg.sender, spender, amount);
|
||||
}
|
||||
|
||||
function allowance(address owner, address spender) constant returns (uint256 remaining, uint256 nonce) {
|
||||
function allowance(address owner, address spender) view returns (uint256 remaining, uint256 nonce) {
|
||||
/*
|
||||
Get the quantity of tokens given to be used
|
||||
|
||||
@@ -386,7 +386,7 @@ contract token is safeMath, module, announcementTypes {
|
||||
}
|
||||
}
|
||||
|
||||
function getTransactionFee(uint256 value) public constant returns (bool success, uint256 fee) {
|
||||
function getTransactionFee(uint256 value) public view returns (bool success, uint256 fee) {
|
||||
/*
|
||||
Transaction fee query.
|
||||
|
||||
@@ -472,7 +472,7 @@ contract token is safeMath, module, announcementTypes {
|
||||
return _codeLength > 0;
|
||||
}
|
||||
|
||||
function balanceOf(address owner) constant returns (uint256 value) {
|
||||
function balanceOf(address owner) view returns (uint256 value) {
|
||||
/*
|
||||
Token balance query
|
||||
|
||||
@@ -483,7 +483,7 @@ contract token is safeMath, module, announcementTypes {
|
||||
return db.balanceOf(owner);
|
||||
}
|
||||
|
||||
function totalSupply() constant returns (uint256 value) {
|
||||
function totalSupply() view returns (uint256 value) {
|
||||
/*
|
||||
Total token quantity query
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ contract tokenDB is safeMath, ownedDB {
|
||||
return true;
|
||||
}
|
||||
|
||||
function getAllowance(address owner, address spender) constant returns(bool success, uint256 remaining, uint256 nonce) {
|
||||
function getAllowance(address owner, address spender) view returns(bool success, uint256 remaining, uint256 nonce) {
|
||||
/*
|
||||
Get allowance from the database.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user