diff options
Diffstat (limited to 'test/compilationTests/corion')
-rw-r--r-- | test/compilationTests/corion/ico.sol | 2 | ||||
-rw-r--r-- | test/compilationTests/corion/module.sol | 2 | ||||
-rw-r--r-- | test/compilationTests/corion/moduleHandler.sol | 38 | ||||
-rw-r--r-- | test/compilationTests/corion/premium.sol | 8 | ||||
-rw-r--r-- | test/compilationTests/corion/provider.sol | 44 | ||||
-rw-r--r-- | test/compilationTests/corion/publisher.sol | 6 | ||||
-rw-r--r-- | test/compilationTests/corion/schelling.sol | 54 | ||||
-rw-r--r-- | test/compilationTests/corion/token.sol | 12 |
8 files changed, 83 insertions, 83 deletions
diff --git a/test/compilationTests/corion/ico.sol b/test/compilationTests/corion/ico.sol index 6c9f8cb2..c61e3448 100644 --- a/test/compilationTests/corion/ico.sol +++ b/test/compilationTests/corion/ico.sol @@ -309,7 +309,7 @@ contract ico is safeMath { require( beneficiaryAddress.send(0.2 ether) ); _value = safeSub(_value, 0.2 ether); } - var _reward = getIcoReward(_value); + uint256 _reward = getIcoReward(_value); require( _reward > 0 ); require( token(tokenAddr).mint(beneficiaryAddress, _reward) ); brought[beneficiaryAddress].eth = safeAdd(brought[beneficiaryAddress].eth, _value); diff --git a/test/compilationTests/corion/module.sol b/test/compilationTests/corion/module.sol index d64044cb..51fb8231 100644 --- a/test/compilationTests/corion/module.sol +++ b/test/compilationTests/corion/module.sol @@ -90,7 +90,7 @@ contract module { @newModuleAddress New module handler address */ require( moduleStatus != status.New && moduleStatus != status.Disconnected); - var (_success, _balance) = abstractModuleHandler(moduleHandlerAddress).balanceOf(address(this)); + (bool _success, uint256 _balance) = abstractModuleHandler(moduleHandlerAddress).balanceOf(address(this)); require( _success ); if ( _balance > 0 ) { require( abstractModuleHandler(moduleHandlerAddress).transfer(address(this), newModuleAddress, _balance, false) ); diff --git a/test/compilationTests/corion/moduleHandler.sol b/test/compilationTests/corion/moduleHandler.sol index 3aefce30..d1f928c5 100644 --- a/test/compilationTests/corion/moduleHandler.sol +++ b/test/compilationTests/corion/moduleHandler.sol @@ -69,7 +69,7 @@ contract moduleHandler is multiOwner, announcementTypes { @call Is connect to the module or not. */ if ( call ) { require( abstractModule(input.addr).connectModule() ); } - var (success, found, id) = getModuleIDByAddress(input.addr); + (bool success, bool found, uint256 id) = getModuleIDByAddress(input.addr); require( success && ! found ); (success, found, id) = getModuleIDByHash(input.name); require( success && ! found ); @@ -90,7 +90,7 @@ contract moduleHandler is multiOwner, announcementTypes { @found Is there any result. @success Was the transaction succesfull or not. */ - var (_success, _found, _id) = getModuleIDByName(name); + (bool _success, bool _found, uint256 _id) = getModuleIDByName(name); if ( _success && _found ) { return (true, true, modules[_id].addr); } return (true, false, 0x00); } @@ -149,7 +149,7 @@ contract moduleHandler is multiOwner, announcementTypes { @bool Was there any result or not. @callCallback Call the replaceable module to confirm replacement or not. */ - var (_success, _found, _id) = getModuleIDByAddress(msg.sender); + (bool _success, bool _found, uint256 _id) = getModuleIDByAddress(msg.sender); require( _success ); if ( ! ( _found && modules[_id].name == keccak256('Publisher') )) { require( block.number < debugModeUntil ); @@ -172,7 +172,7 @@ contract moduleHandler is multiOwner, announcementTypes { if ( ! insertAndCheckDo(calcDoHash("callReplaceCallback", keccak256(moduleName, newModule))) ) { return true; } - var (_success, _found, _id) = getModuleIDByName(moduleName); + (bool _success, bool _found, uint256 _id) = getModuleIDByName(moduleName); require( _success); require( abstractModule(modules[_id].addr).replaceModule(newModule) ); return true; @@ -188,7 +188,7 @@ contract moduleHandler is multiOwner, announcementTypes { @transferEvent Gets it new transaction notification? @bool Was there any result or not. */ - var (_success, _found, _id) = getModuleIDByAddress(msg.sender); + (bool _success, bool _found, uint256 _id) = getModuleIDByAddress(msg.sender); require( _success ); if ( ! ( _found && modules[_id].name == keccak256('Publisher') )) { require( block.number < debugModeUntil ); @@ -207,7 +207,7 @@ contract moduleHandler is multiOwner, announcementTypes { @bool Was the function successfull? @callCallback Call the replaceable module to confirm replacement or not. */ - var (_success, _found, _id) = getModuleIDByAddress(msg.sender); + (bool _success, bool _found, uint256 _id) = getModuleIDByAddress(msg.sender); require( _success ); if ( ! ( _found && modules[_id].name == keccak256('Publisher') )) { require( block.number < debugModeUntil ); @@ -229,7 +229,7 @@ contract moduleHandler is multiOwner, announcementTypes { if ( ! insertAndCheckDo(calcDoHash("callDisableCallback", keccak256(moduleName))) ) { return true; } - var (_success, _found, _id) = getModuleIDByName(moduleName); + (bool _success, bool _found, uint256 _id) = getModuleIDByName(moduleName); require( _success); require( abstractModule(modules[_id].addr).disableModule(true) ); return true; @@ -247,7 +247,7 @@ contract moduleHandler is multiOwner, announcementTypes { @value amount. @bool Was the function successfull? */ - var (_success, _found, _id) = getModuleIDByAddress(msg.sender); + (bool _success, bool _found, uint256 _id) = getModuleIDByAddress(msg.sender); require( _success && _found && modules[_id].name == keccak256('Token') ); for ( uint256 a=0 ; a<modules.length ; a++ ) { if ( modules[a].transferEvent && abstractModule(modules[a].addr).isActive() ) { @@ -266,7 +266,7 @@ contract moduleHandler is multiOwner, announcementTypes { @reward Coin emission in this Schelling round. @bool Was the function successfull? */ - var (_success, _found, _id) = getModuleIDByAddress(msg.sender); + (bool _success, bool _found, uint256 _id) = getModuleIDByAddress(msg.sender); require( _success && _found && modules[_id].name == keccak256('Schelling') ); for ( uint256 a=0 ; a<modules.length ; a++ ) { if ( modules[a].schellingEvent && abstractModule(modules[a].addr).isActive() ) { @@ -285,7 +285,7 @@ contract moduleHandler is multiOwner, announcementTypes { @newHandler Address of the new ModuleHandler. @bool Was the function successfull? */ - var (_success, _found, _id) = getModuleIDByAddress(msg.sender); + (bool _success, bool _found, uint256 _id) = getModuleIDByAddress(msg.sender); require( _success ); if ( ! ( _found && modules[_id].name == keccak256('Publisher') )) { require( block.number < debugModeUntil ); @@ -306,7 +306,7 @@ contract moduleHandler is multiOwner, announcementTypes { @value balance. @success was the function successfull? */ - var (_success, _found, _id) = getModuleIDByName('Token'); + (bool _success, bool _found, uint256 _id) = getModuleIDByName('Token'); require( _success && _found ); return (true, token(modules[_id].addr).balanceOf(owner)); } @@ -317,7 +317,7 @@ contract moduleHandler is multiOwner, announcementTypes { @value amount. @success was the function successfull? */ - var (_success, _found, _id) = getModuleIDByName('Token'); + (bool _success, bool _found, uint256 _id) = getModuleIDByName('Token'); require( _success && _found ); return (true, token(modules[_id].addr).totalSupply()); } @@ -328,7 +328,7 @@ contract moduleHandler is multiOwner, announcementTypes { @ico Is ICO in progress?. @success was the function successfull? */ - var (_success, _found, _id) = getModuleIDByName('Token'); + (bool _success, bool _found, uint256 _id) = getModuleIDByName('Token'); require( _success && _found ); return (true, token(modules[_id].addr).isICO()); } @@ -339,7 +339,7 @@ contract moduleHandler is multiOwner, announcementTypes { @round Schelling round. @success was the function successfull? */ - var (_success, _found, _id) = getModuleIDByName('Schelling'); + (bool _success, bool _found, uint256 _id) = getModuleIDByName('Schelling'); require( _success && _found ); return (true, schelling(modules[_id].addr).getCurrentSchellingRoundID()); } @@ -352,7 +352,7 @@ contract moduleHandler is multiOwner, announcementTypes { @success Was the function successfull? */ - var (_success, _found, _id) = getModuleIDByAddress(msg.sender); + (bool _success, bool _found, uint256 _id) = getModuleIDByAddress(msg.sender); require( _success && _found && modules[_id].name == keccak256('Provider') ); (_success, _found, _id) = getModuleIDByName('Token'); require( _success && _found ); @@ -369,7 +369,7 @@ contract moduleHandler is multiOwner, announcementTypes { @fee Transaction fee will be charged or not? @success Was the function successfull? */ - var (_success, _found, _id) = getModuleIDByAddress(msg.sender); + (bool _success, bool _found, uint256 _id) = getModuleIDByAddress(msg.sender); require( _success && _found ); (_success, _found, _id) = getModuleIDByName('Token'); require( _success && _found ); @@ -384,7 +384,7 @@ contract moduleHandler is multiOwner, announcementTypes { @value Token amount. @success Was the function successfull? */ - var (_success, _found, _id) = getModuleIDByAddress(msg.sender); + (bool _success, bool _found, uint256 _id) = getModuleIDByAddress(msg.sender); require( _success && _found && modules[_id].name == keccak256('Provider') ); (_success, _found, _id) = getModuleIDByName('Token'); require( _success && _found ); @@ -399,7 +399,7 @@ contract moduleHandler is multiOwner, announcementTypes { @value Token amount. @success Was the function successfull? */ - var (_success, _found, _id) = getModuleIDByAddress(msg.sender); + (bool _success, bool _found, uint256 _id) = getModuleIDByAddress(msg.sender); require( _success && _found && modules[_id].name == keccak256('Schelling') ); (_success, _found, _id) = getModuleIDByName('Token'); require( _success && _found ); @@ -415,7 +415,7 @@ contract moduleHandler is multiOwner, announcementTypes { @value New value @success Was the function successfull? */ - var (_success, _found, _id) = getModuleIDByAddress(msg.sender); + (bool _success, bool _found, uint256 _id) = getModuleIDByAddress(msg.sender); require( _success ); if ( ! ( _found && modules[_id].name == keccak256('Publisher') )) { require( block.number < debugModeUntil ); diff --git a/test/compilationTests/corion/premium.sol b/test/compilationTests/corion/premium.sol index be2c5de0..2cf76088 100644 --- a/test/compilationTests/corion/premium.sol +++ b/test/compilationTests/corion/premium.sol @@ -19,7 +19,7 @@ contract premium is module, safeMath { return true; } modifier isReady { - var (_success, _active) = super.isActive(); + (bool _success, bool _active) = super.isActive(); require( _success && _active ); _; } @@ -150,7 +150,7 @@ contract premium is module, safeMath { @remaining Tokens to be spent @nonce Transaction count */ - var (_success, _remaining, _nonce) = db.getAllowance(owner, spender); + (bool _success, uint256 _remaining, uint256 _nonce) = db.getAllowance(owner, spender); require( _success ); return (_remaining, _nonce); } @@ -202,7 +202,7 @@ contract premium is module, safeMath { @success If the function was successful. */ if ( from != msg.sender ) { - var (_success, _reamining, _nonce) = db.getAllowance(from, msg.sender); + (bool _success, uint256 _reamining, uint256 _nonce) = db.getAllowance(from, msg.sender); require( _success ); _reamining = safeSub(_reamining, amount); _nonce = safeAdd(_nonce, 1); @@ -255,7 +255,7 @@ contract premium is module, safeMath { @extraData Extra data that will be given to the receiver */ _transfer(from, to, amount); - var (_success, _back) = thirdPartyPContractAbstract(to).receiveCorionPremiumToken(from, amount, extraData); + (bool _success, uint256 _back) = thirdPartyPContractAbstract(to).receiveCorionPremiumToken(from, amount, extraData); require( _success ); require( amount > _back ); if ( _back > 0 ) { diff --git a/test/compilationTests/corion/provider.sol b/test/compilationTests/corion/provider.sol index dba1253d..2cdd760d 100644 --- a/test/compilationTests/corion/provider.sol +++ b/test/compilationTests/corion/provider.sol @@ -12,7 +12,7 @@ contract provider is module, safeMath, announcementTypes { function connectModule() external returns (bool success) { require( super.isModuleHandler(msg.sender) ); super._connectModule(); - var (_success, currentSchellingRound) = moduleHandler(moduleHandlerAddress).getCurrentSchellingRoundID(); + (bool _success, uint256 currentSchellingRound) = moduleHandler(moduleHandlerAddress).getCurrentSchellingRoundID(); require( _success ); return true; } @@ -49,7 +49,7 @@ contract provider is module, safeMath, announcementTypes { return true; } modifier isReady { - var (_success, _active) = super.isActive(); + (bool _success, bool _active) = super.isActive(); require( _success && _active ); _; } @@ -192,8 +192,8 @@ contract provider is module, safeMath, announcementTypes { @newValue new @priv Is the provider private? */ - var a = rightForInterest(oldValue, priv); - var b = rightForInterest(newValue, priv); + bool a = rightForInterest(oldValue, priv); + bool b = rightForInterest(newValue, priv); if ( a && b ) { globalFunds[currentSchellingRound].supply = globalFunds[currentSchellingRound].supply - oldValue + newValue; } else if ( a && ! b ) { @@ -243,7 +243,7 @@ contract provider is module, safeMath, announcementTypes { require( checkCorrectRate(priv, rate) ); providers[msg.sender].currentHeight++; - var currHeight = providers[msg.sender].currentHeight; + uint256 currHeight = providers[msg.sender].currentHeight; providers[msg.sender].data[currHeight].valid = true; if ( admin == 0x00 ) { providers[msg.sender].data[currHeight].admin = msg.sender; @@ -284,7 +284,7 @@ contract provider is module, safeMath, announcementTypes { @info Short intro. @rate Rate of the emission what will be given to the client. */ - var currHeight = providers[addr].currentHeight; + uint256 currHeight = providers[addr].currentHeight; require( providers[addr].data[currHeight].valid ); require( checkCorrectRate(providers[addr].data[currHeight].priv, rate) ); require( providers[addr].data[currHeight].admin == msg.sender || msg.sender == addr ); @@ -360,7 +360,7 @@ contract provider is module, safeMath, announcementTypes { It is only possible to close that active provider which is owned by the sender itself after calling the whole share of the emission. Whom were connected to the provider those clients will have to disconnect after they’ve called their share of emission which was not called before. */ - var currHeight = providers[msg.sender].currentHeight; + uint256 currHeight = providers[msg.sender].currentHeight; require( providers[msg.sender].data[currHeight].valid ); require( providers[msg.sender].data[currHeight].paidUpTo == currentSchellingRound ); @@ -377,7 +377,7 @@ contract provider is module, safeMath, announcementTypes { @addr Array of the addresses for whom the connection is allowed. */ - var currHeight = providers[provider].currentHeight; + uint256 currHeight = providers[provider].currentHeight; require( providers[provider].data[currHeight].valid ); require( providers[provider].data[currHeight].priv ); require( providers[provider].data[currHeight].admin == msg.sender ); @@ -395,7 +395,7 @@ contract provider is module, safeMath, announcementTypes { @addr Array of the addresses for whom the connection is allowed. */ - var currHeight = providers[provider].currentHeight; + uint256 currHeight = providers[provider].currentHeight; require( providers[provider].data[currHeight].valid ); require( providers[provider].data[currHeight].priv ); require( providers[provider].data[currHeight].admin == msg.sender ); @@ -417,7 +417,7 @@ contract provider is module, safeMath, announcementTypes { @provider Address of the provider. */ - var currHeight = providers[provider].currentHeight; + uint256 currHeight = providers[provider].currentHeight; require( ! providers[msg.sender].data[currHeight].valid ); require( clients[msg.sender].providerAddress == 0x00 ); require( providers[provider].data[currHeight].valid ); @@ -425,7 +425,7 @@ contract provider is module, safeMath, announcementTypes { require( providers[provider].data[currHeight].allowedUsers[msg.sender] && providers[provider].data[currHeight].clientsCount < privateProviderLimit ); } - var bal = getTokenBalance(msg.sender); + uint256 bal = getTokenBalance(msg.sender); require( moduleHandler(moduleHandlerAddress).processTransactionFee(msg.sender, bal) ); checkFloatingSupply(provider, currHeight, false, bal); @@ -445,9 +445,9 @@ contract provider is module, safeMath, announcementTypes { Before disconnecting we should poll our share from the token emission even if there was nothing factually. It is only possible to disconnect those providers who were connected by us before. */ - var provider = clients[msg.sender].providerAddress; + address provider = clients[msg.sender].providerAddress; require( provider != 0x0 ); - var currHeight = clients[msg.sender].providerHeight; + uint256 currHeight = clients[msg.sender].providerHeight; bool providerHasClosed = false; if ( providers[provider].data[currHeight].close > 0 ) { providerHasClosed = true; @@ -456,7 +456,7 @@ contract provider is module, safeMath, announcementTypes { require( clients[msg.sender].paidUpTo == currentSchellingRound ); } - var bal = getTokenBalance(msg.sender); + uint256 bal = getTokenBalance(msg.sender); if ( ! providerHasClosed ) { providers[provider].data[currHeight].clientsCount--; checkFloatingSupply(provider, currHeight, true, bal); @@ -500,9 +500,9 @@ contract provider is module, safeMath, announcementTypes { @provider Address of the provider @reward Accumulated amount from the previous rounds. */ - var _limit = limit; - var _beneficiary = beneficiary; - var _provider = provider; + uint256 _limit = limit; + address _beneficiary = beneficiary; + address _provider = provider; if ( _limit == 0 ) { _limit = gasProtectMaxRounds; } if ( _beneficiary == 0x00 ) { _beneficiary = msg.sender; } if ( _provider == 0x00 ) { _provider = msg.sender; } @@ -537,7 +537,7 @@ contract provider is module, safeMath, announcementTypes { uint256 provHeight; bool interest = false; uint256 a; - var rate = clients[msg.sender].lastRate; + uint8 rate = clients[msg.sender].lastRate; for ( a = (clients[msg.sender].paidUpTo + 1) ; a <= currentSchellingRound ; a++ ) { if (globalFunds[a].reward > 0 && globalFunds[a].supply > 0) { provAddr = clients[msg.sender].providerAddress; @@ -587,7 +587,7 @@ contract provider is module, safeMath, announcementTypes { uint256 currHeight = providers[addr].currentHeight; uint256 LTSID = providers[addr].data[currHeight].lastSupplyID; uint256 a; - var rate = providers[addr].data[currHeight].lastPaidRate; + uint8 rate = providers[addr].data[currHeight].lastPaidRate; for ( a = (providers[addr].data[currHeight].paidUpTo + 1) ; a <= currentSchellingRound ; a++ ) { if (globalFunds[a].reward > 0 && globalFunds[a].supply > 0) { if ( providers[addr].data[currHeight].rateHistory[a].valid ) { @@ -754,7 +754,7 @@ contract provider is module, safeMath, announcementTypes { clients[addr].supply[currentSchellingRound] = TEMath(clients[addr].supply[currentSchellingRound], value, neg); } } else if ( providers[addr].data[providers[addr].currentHeight].valid ) { - var currentHeight = providers[addr].currentHeight; + uint256 currentHeight = providers[addr].currentHeight; if ( neg ) { uint256 balance = getTokenBalance(addr); if ( providers[addr].data[currentHeight].priv ) { @@ -776,7 +776,7 @@ contract provider is module, safeMath, announcementTypes { @balance Balance of the address. */ - var (_success, _balance) = moduleHandler(moduleHandlerAddress).balanceOf(addr); + (bool _success, uint256 _balance) = moduleHandler(moduleHandlerAddress).balanceOf(addr); require( _success ); return _balance; } @@ -786,7 +786,7 @@ contract provider is module, safeMath, announcementTypes { @isICO Is the ICO in proccess or not? */ - var (_success, _isICO) = moduleHandler(moduleHandlerAddress).isICO(); + (bool _success, bool _isICO) = moduleHandler(moduleHandlerAddress).isICO(); require( _success ); return _isICO; } diff --git a/test/compilationTests/corion/publisher.sol b/test/compilationTests/corion/publisher.sol index e94b9a92..98d5af2a 100644 --- a/test/compilationTests/corion/publisher.sol +++ b/test/compilationTests/corion/publisher.sol @@ -111,7 +111,7 @@ contract publisher is announcementTypes, module, safeMath { @success Opposed or not
*/
if ( ! oppositable ) { return false; }
- var (_success, _amount) = moduleHandler(moduleHandlerAddress).totalSupply();
+ (bool _success, uint256 _amount) = moduleHandler(moduleHandlerAddress).totalSupply();
require( _success );
return _amount * oppositeRate / 100 > weight;
}
@@ -229,7 +229,7 @@ contract publisher is announcementTypes, module, safeMath { newArrayID = a;
}
}
- var (_success, _balance) = moduleHandler(moduleHandlerAddress).balanceOf(msg.sender);
+ (bool _success, uint256 _balance) = moduleHandler(moduleHandlerAddress).balanceOf(msg.sender);
require( _success );
require( _balance > 0);
if ( foundEmptyArrayID ) {
@@ -266,7 +266,7 @@ contract publisher is announcementTypes, module, safeMath { Inner function to check the ICO status.
@bool Is the ICO in proccess or not?
*/
- var (_success, _isICO) = moduleHandler(moduleHandlerAddress).isICO();
+ (bool _success, bool _isICO) = moduleHandler(moduleHandlerAddress).isICO();
require( _success );
return _isICO;
}
diff --git a/test/compilationTests/corion/schelling.sol b/test/compilationTests/corion/schelling.sol index b74cfb46..8f38ec64 100644 --- a/test/compilationTests/corion/schelling.sol +++ b/test/compilationTests/corion/schelling.sol @@ -151,15 +151,15 @@ contract schelling is module, announcementTypes, schellingVars { */ require( super.isModuleHandler(msg.sender) ); if ( to == address(this) ) { - var currentRound = getCurrentRound(); - var round = getRound(currentRound); + uint256 currentRound = getCurrentRound(); + schellingVars._rounds memory round = getRound(currentRound); round.reward += value; setRound(currentRound, round); } return true; } modifier isReady { - var (_success, _active) = super.isActive(); + (bool _success, bool _active) = super.isActive(); require( _success && _active ); _; } @@ -167,7 +167,7 @@ contract schelling is module, announcementTypes, schellingVars { Schelling database functions. */ function getFunds(address addr) internal returns (uint256) { - var (a, b) = db.getFunds(addr); + (bool a, uint256 b) = db.getFunds(addr); require( a ); return b; } @@ -184,7 +184,7 @@ contract schelling is module, announcementTypes, schellingVars { ) ); } function getVoter(address addr) internal returns (_voter) { - var (a, b, c, d, e, f) = db.getVoter(addr); + (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); } @@ -198,7 +198,7 @@ contract schelling is module, announcementTypes, schellingVars { ) ); } function pushRound(_rounds round) internal returns (uint256) { - var (a, b) = db.pushRound( + (bool a, uint256 b) = db.pushRound( round.totalAboveWeight, round.totalBelowWeight, round.reward, @@ -209,12 +209,12 @@ contract schelling is module, announcementTypes, schellingVars { return b; } function getRound(uint256 id) internal returns (_rounds) { - var (a, b, c, d, e, f) = db.getRound(id); + (bool a, uint256 b, uint256 c, uint256 d, uint256 e, bool f) = db.getRound(id); require( a ); return _rounds(b, c, d, e, f); } function getCurrentRound() internal returns (uint256) { - var (a, b) = db.getCurrentRound(); + (bool a, uint256 b) = db.getCurrentRound(); require( a ); return b; } @@ -222,7 +222,7 @@ contract schelling is module, announcementTypes, schellingVars { require( db.setCurrentSchellingRound(id) ); } function getCurrentSchellingRound() internal returns(uint256) { - var (a, b) = db.getCurrentSchellingRound(); + (bool a, uint256 b) = db.getCurrentSchellingRound(); require( a ); return b; } @@ -230,7 +230,7 @@ contract schelling is module, announcementTypes, schellingVars { require( db.setSchellingExpansion(id, amount) ); } function getSchellingExpansion(uint256 id) internal returns(uint256) { - var (a, b) = db.getSchellingExpansion(id); + (bool a, uint256 b) = db.getSchellingExpansion(id); require( a ); return b; } @@ -289,8 +289,8 @@ contract schelling is module, announcementTypes, schellingVars { */ nextRound(); - var currentRound = getCurrentRound(); - var round = getRound(currentRound); + uint256 currentRound = getCurrentRound(); + schellingVars._rounds memory round = getRound(currentRound); _voter memory voter; uint256 funds; @@ -323,7 +323,7 @@ contract schelling is module, announcementTypes, schellingVars { */ nextRound(); - var currentRound = getCurrentRound(); + uint256 currentRound = getCurrentRound(); _rounds memory round; _voter memory voter; uint256 funds; @@ -369,7 +369,7 @@ contract schelling is module, announcementTypes, schellingVars { */ nextRound(); - var currentRound = getCurrentRound(); + uint256 currentRound = getCurrentRound(); _rounds memory round; _voter memory voter; uint256 funds; @@ -403,8 +403,8 @@ contract schelling is module, announcementTypes, schellingVars { @beneficiary Address of the beneficiary */ - var voter = getVoter(msg.sender); - var funds = getFunds(msg.sender); + schellingVars._voter memory voter = getVoter(msg.sender); + uint256 funds = getFunds(msg.sender); address _beneficiary = msg.sender; if (beneficiary != 0x0) { _beneficiary = beneficiary; } @@ -423,18 +423,18 @@ contract schelling is module, announcementTypes, schellingVars { @reward Prize */ - var voter = getVoter(msg.sender); + schellingVars._voter memory voter = getVoter(msg.sender); return voter.rewards; } function nextRound() internal returns (bool) { /* Inside function, checks the time of the Schelling round and if its needed, creates a new Schelling round. */ - var currentRound = getCurrentRound(); - var round = getRound(currentRound); + uint256 currentRound = getCurrentRound(); + _rounds memory round = getRound(currentRound); _rounds memory newRound; _rounds memory prevRound; - var currentSchellingRound = getCurrentSchellingRound(); + uint256 currentSchellingRound = getCurrentSchellingRound(); if ( round.blockHeight+roundBlockDelay > block.number) { return false; } @@ -469,10 +469,10 @@ contract schelling is module, announcementTypes, schellingVars { @amount Amount of deposit. */ - var voter = getVoter(msg.sender); - var funds = getFunds(msg.sender); + _voter memory voter = getVoter(msg.sender); + uint256 funds = getFunds(msg.sender); - var (a, b) = moduleHandler(moduleHandlerAddress).isICO(); + (bool a, bool b) = moduleHandler(moduleHandlerAddress).isICO(); require( b && b ); require( voter.status == voterStatus.base ); require( amount > 0 ); @@ -487,8 +487,8 @@ contract schelling is module, announcementTypes, schellingVars { If the deposit isn’t lost, it can be withdrawn. By withdrawn, the deposit will be sent from Schelling address to the users address, charged with transaction fee.. */ - var voter = getVoter(msg.sender); - var funds = getFunds(msg.sender); + _voter memory voter = getVoter(msg.sender); + uint256 funds = getFunds(msg.sender); require( funds > 0 ); require( voter.status == voterStatus.base ); @@ -550,7 +550,7 @@ contract schelling is module, announcementTypes, schellingVars { @uint256 Whole token amount */ - var (_success, _amount) = moduleHandler(moduleHandlerAddress).totalSupply(); + (bool _success, uint256 _amount) = moduleHandler(moduleHandlerAddress).totalSupply(); require( _success ); return _amount; } @@ -563,7 +563,7 @@ contract schelling is module, announcementTypes, schellingVars { @balance Balance of the address. */ - var (_success, _balance) = moduleHandler(moduleHandlerAddress).balanceOf(addr); + (bool _success, uint256 _balance) = moduleHandler(moduleHandlerAddress).balanceOf(addr); require( _success ); return _balance; } diff --git a/test/compilationTests/corion/token.sol b/test/compilationTests/corion/token.sol index 3aa0bf23..3a6a4598 100644 --- a/test/compilationTests/corion/token.sol +++ b/test/compilationTests/corion/token.sol @@ -22,7 +22,7 @@ contract token is safeMath, module, announcementTypes { return true; } modifier isReady { - var (_success, _active) = super.isActive(); + (bool _success, bool _active) = super.isActive(); require( _success && _active ); _; } @@ -165,7 +165,7 @@ contract token is safeMath, module, announcementTypes { @remaining Tokens to be spent @nonce Transaction count */ - var (_success, _remaining, _nonce) = db.getAllowance(owner, spender); + (bool _success, uint256 _remaining, uint256 _nonce) = db.getAllowance(owner, spender); require( _success ); return (_remaining, _nonce); } @@ -217,7 +217,7 @@ contract token is safeMath, module, announcementTypes { @success Was the Function successful? */ if ( from != msg.sender ) { - var (_success, _reamining, _nonce) = db.getAllowance(from, msg.sender); + (bool _success, uint256 _reamining, uint256 _nonce) = db.getAllowance(from, msg.sender); require( _success ); _reamining = safeSub(_reamining, amount); _nonce = safeAdd(_nonce, 1); @@ -298,7 +298,7 @@ contract token is safeMath, module, announcementTypes { @extraData Extra data the receiver will get */ _transfer(from, to, amount, exchangeAddress == to); - var (_success, _back) = thirdPartyContractAbstract(to).receiveCorionToken(from, amount, extraData); + (bool _success, uint256 _back) = thirdPartyContractAbstract(to).receiveCorionToken(from, amount, extraData); require( _success ); require( amount > _back ); if ( _back > 0 ) { @@ -321,7 +321,7 @@ contract token is safeMath, module, announcementTypes { @fee Deduct transaction fee - yes or no? */ if( fee ) { - var (success, _fee) = getTransactionFee(amount); + (bool success, uint256 _fee) = getTransactionFee(amount); require( success ); require( db.balanceOf(from) >= amount + _fee ); } @@ -366,7 +366,7 @@ contract token is safeMath, module, announcementTypes { @value Quantity to calculate the fee */ if ( isICO ) { return; } - var (_success, _fee) = getTransactionFee(value); + (bool _success, uint256 _fee) = getTransactionFee(value); require( _success ); uint256 _forBurn = _fee * transactionFeeBurn / 100; uint256 _forSchelling = _fee - _forBurn; |