aboutsummaryrefslogtreecommitdiffstats
path: root/test/compilationTests/corion
diff options
context:
space:
mode:
Diffstat (limited to 'test/compilationTests/corion')
-rw-r--r--test/compilationTests/corion/ico.sol14
-rw-r--r--test/compilationTests/corion/module.sol22
-rw-r--r--test/compilationTests/corion/moduleHandler.sol8
-rw-r--r--test/compilationTests/corion/premium.sol4
-rw-r--r--test/compilationTests/corion/provider.sol12
-rw-r--r--test/compilationTests/corion/publisher.sol8
-rw-r--r--test/compilationTests/corion/schelling.sol6
-rw-r--r--test/compilationTests/corion/token.sol8
8 files changed, 42 insertions, 40 deletions
diff --git a/test/compilationTests/corion/ico.sol b/test/compilationTests/corion/ico.sol
index b1e0bf75..e660389b 100644
--- a/test/compilationTests/corion/ico.sol
+++ b/test/compilationTests/corion/ico.sol
@@ -27,12 +27,12 @@ contract ico is safeMath {
uint256 constant oneSegment = 40320;
- address public owner;
- address public tokenAddr;
- address public premiumAddr;
+ address payable public owner;
+ address payable public tokenAddr;
+ address payable public premiumAddr;
uint256 public startBlock;
uint256 public icoDelay;
- address public foundationAddress;
+ address payable public foundationAddress;
address public icoEtcPriceAddr;
uint256 public icoExchangeRate;
uint256 public icoExchangeRateSetBlock;
@@ -50,7 +50,7 @@ contract ico is safeMath {
uint256 public totalMint;
uint256 public totalPremiumMint;
- constructor(address foundation, address priceSet, uint256 exchangeRate, uint256 startBlockNum, address[] memory genesisAddr, uint256[] memory genesisValue) public {
+ constructor(address payable foundation, address priceSet, uint256 exchangeRate, uint256 startBlockNum, address[] memory genesisAddr, uint256[] memory genesisValue) public {
/*
Installation function.
@@ -248,7 +248,7 @@ contract ico is safeMath {
aborted = true;
}
- function connectTokens(address tokenContractAddr, address premiumContractAddr) external {
+ function connectTokens(address payable tokenContractAddr, address payable premiumContractAddr) external {
/*
Installation function which joins the two token contracts with this contract.
Only callable by the owner
@@ -284,7 +284,7 @@ contract ico is safeMath {
require( buy(msg.sender, address(0x00)) );
}
- function buy(address beneficiaryAddress, address affilateAddress) public payable returns (bool success) {
+ function buy(address payable beneficiaryAddress, address affilateAddress) public payable returns (bool success) {
/*
Buying a token
diff --git a/test/compilationTests/corion/module.sol b/test/compilationTests/corion/module.sol
index da4dd344..bd6952b1 100644
--- a/test/compilationTests/corion/module.sol
+++ b/test/compilationTests/corion/module.sol
@@ -1,8 +1,8 @@
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 view returns (bool success, uint256 value) {}
+ function transfer(address payable from, address payable to, uint256 value, bool fee) external returns (bool success) {}
+ function balanceOf(address payable owner) public view returns (bool success, uint256 value) {}
}
contract module {
@@ -19,7 +19,7 @@ contract module {
status public moduleStatus;
uint256 public disabledUntil;
- address public moduleHandlerAddress;
+ address payable public moduleHandlerAddress;
function disableModule(bool forever) external onlyForModuleHandler returns (bool success) {
_disableModule(forever);
@@ -36,11 +36,11 @@ contract module {
else { disabledUntil = block.number + 5760; }
}
- function replaceModuleHandler(address newModuleHandlerAddress) external onlyForModuleHandler returns (bool success) {
+ function replaceModuleHandler(address payable newModuleHandlerAddress) external onlyForModuleHandler returns (bool success) {
_replaceModuleHandler(newModuleHandlerAddress);
return true;
}
- function _replaceModuleHandler(address newModuleHandlerAddress) internal {
+ function _replaceModuleHandler(address payable newModuleHandlerAddress) internal {
/*
Replace the ModuleHandler address.
This function calls the Publisher module.
@@ -77,11 +77,11 @@ contract module {
moduleStatus = status.Disconnected;
}
- function replaceModule(address newModuleAddress) external onlyForModuleHandler returns (bool success) {
+ function replaceModule(address payable newModuleAddress) external onlyForModuleHandler returns (bool success) {
_replaceModule(newModuleAddress);
return true;
}
- function _replaceModule(address newModuleAddress) internal {
+ function _replaceModule(address payable newModuleAddress) internal {
/*
Replace the module for an another new module.
This function calls the Publisher module.
@@ -101,20 +101,20 @@ contract module {
moduleStatus = status.Disconnected;
}
- function transferEvent(address from, address to, uint256 value) external onlyForModuleHandler returns (bool success) {
+ function transferEvent(address payable from, address payable to, uint256 value) external onlyForModuleHandler returns (bool success) {
return true;
}
function newSchellingRoundEvent(uint256 roundID, uint256 reward) external onlyForModuleHandler returns (bool success) {
return true;
}
- function registerModuleHandler(address _moduleHandlerAddress) internal {
+ function registerModuleHandler(address payable _moduleHandlerAddress) internal {
/*
Module constructor function for registering ModuleHandler address.
*/
moduleHandlerAddress = _moduleHandlerAddress;
}
- function isModuleHandler(address addr) internal returns (bool ret) {
+ function isModuleHandler(address payable addr) internal returns (bool ret) {
/*
Test for ModuleHandler address.
If the module is not connected then returns always false.
@@ -140,4 +140,6 @@ contract module {
require( msg.sender == moduleHandlerAddress );
_;
}
+ function() external payable {
+ }
}
diff --git a/test/compilationTests/corion/moduleHandler.sol b/test/compilationTests/corion/moduleHandler.sol
index 2b513eb1..6b0daf0d 100644
--- a/test/compilationTests/corion/moduleHandler.sol
+++ b/test/compilationTests/corion/moduleHandler.sol
@@ -25,7 +25,7 @@ contract abstractModule {
contract moduleHandler is multiOwner, announcementTypes {
struct modules_s {
- address addr;
+ address payable addr;
bytes32 name;
bool schellingEvent;
bool transferEvent;
@@ -37,7 +37,7 @@ contract moduleHandler is multiOwner, announcementTypes {
constructor(address[] memory newOwners) multiOwner(newOwners) public {}
- function load(address foundation, bool forReplace, address Token, address Premium, address Publisher, address Schelling, address Provider) public {
+ function load(address payable foundation, bool forReplace, address payable Token, address payable Premium, address payable Publisher, address payable Schelling, address payable Provider) public {
/*
Loading modulest to ModuleHandler.
@@ -140,7 +140,7 @@ contract moduleHandler is multiOwner, announcementTypes {
}
return (true, false, 0);
}
- function replaceModule(string calldata name, address addr, bool callCallback) external returns (bool success) {
+ function replaceModule(string calldata name, address payable addr, bool callCallback) external returns (bool success) {
/*
Module replace, can be called only by the Publisher contract.
@@ -178,7 +178,7 @@ contract moduleHandler is multiOwner, announcementTypes {
return true;
}
- function newModule(string calldata name, address addr, bool schellingEvent, bool transferEvent) external returns (bool success) {
+ function newModule(string calldata name, address payable addr, bool schellingEvent, bool transferEvent) external returns (bool success) {
/*
Adding new module to the database. Can be called only by the Publisher contract.
diff --git a/test/compilationTests/corion/premium.sol b/test/compilationTests/corion/premium.sol
index 84277a99..4952a740 100644
--- a/test/compilationTests/corion/premium.sol
+++ b/test/compilationTests/corion/premium.sol
@@ -12,7 +12,7 @@ contract thirdPartyPContractAbstract {
contract ptokenDB is tokenDB {}
contract premium is module, safeMath {
- function replaceModule(address addr) external returns (bool success) {
+ function replaceModule(address payable addr) external returns (bool success) {
require( super.isModuleHandler(msg.sender) );
require( db.replaceOwner(addr) );
super._replaceModule(addr);
@@ -40,7 +40,7 @@ contract premium is module, safeMath {
mapping(address => bool) public genesis;
- constructor(bool forReplace, address moduleHandler, address dbAddress, address icoContractAddr, address[] memory genesisAddr, uint256[] memory genesisValue) public {
+ constructor(bool forReplace, address payable moduleHandler, address dbAddress, address icoContractAddr, address[] memory genesisAddr, uint256[] memory genesisValue) public {
/*
Setup function.
If an ICOaddress is defined then the balance of the genesis addresses will be set as well.
diff --git a/test/compilationTests/corion/provider.sol b/test/compilationTests/corion/provider.sol
index 41857e54..b3b5e8ca 100644
--- a/test/compilationTests/corion/provider.sol
+++ b/test/compilationTests/corion/provider.sol
@@ -16,7 +16,7 @@ contract provider is module, safeMath, announcementTypes {
require( _success );
return true;
}
- function transferEvent(address from, address to, uint256 value) external returns (bool success) {
+ function transferEvent(address payable from, address payable to, uint256 value) external returns (bool success) {
/*
Transaction completed. This function is only available for the modulehandler.
It should be checked if the sender or the acceptor does not connect to the provider or it is not a provider itself if so than the change should be recorded.
@@ -118,7 +118,7 @@ contract provider is module, safeMath, announcementTypes {
uint256 private currentSchellingRound = 1;
- constructor(address _moduleHandler) public {
+ constructor(address payable _moduleHandler) public {
/*
Install function.
@@ -147,7 +147,7 @@ contract provider is module, safeMath, announcementTypes {
else { return false; }
return true;
}
- function getUserDetails(address addr, uint256 schellingRound) public view returns (address ProviderAddress, uint256 ProviderHeight, uint256 ConnectedOn, uint256 value) {
+ function getUserDetails(address payable addr, uint256 schellingRound) public view returns (address ProviderAddress, uint256 ProviderHeight, uint256 ConnectedOn, uint256 value) {
/*
Collecting the datas of the client.
@@ -213,7 +213,7 @@ contract provider is module, safeMath, announcementTypes {
return ( ! priv && ( rate >= publicMinRate && rate <= publicMaxRate ) ) ||
( priv && ( rate >= privateMinRate && rate <= privateMaxRate ) );
}
- function createProvider(bool priv, string calldata name, string calldata website, string calldata country, string calldata info, uint8 rate, bool isForRent, address admin) isReady external {
+ function createProvider(bool priv, string calldata name, string calldata website, string calldata country, string calldata info, uint8 rate, bool isForRent, address payable admin) isReady external {
/*
Creating a provider.
During the ICO its not allowed to create provider.
@@ -270,7 +270,7 @@ contract provider is module, safeMath, announcementTypes {
}
emit EProviderOpen(msg.sender, currHeight);
}
- function setProviderDetails(address addr, string calldata website, string calldata country, string calldata info, uint8 rate, address admin) isReady external {
+ function setProviderDetails(address payable addr, string calldata website, string calldata country, string calldata info, uint8 rate, address payable admin) isReady external {
/*
Modifying the datas of the provider.
This can only be invited by the provider’s admin.
@@ -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 view returns (uint8 rate, bool isForRent, uint256 clientsCount, bool priv, bool getInterest, bool valid) {
+ function getProviderDetails(address payable 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.
diff --git a/test/compilationTests/corion/publisher.sol b/test/compilationTests/corion/publisher.sol
index 6a77bc9e..48090d02 100644
--- a/test/compilationTests/corion/publisher.sol
+++ b/test/compilationTests/corion/publisher.sol
@@ -9,7 +9,7 @@ contract publisher is announcementTypes, module, safeMath {
/*
module callbacks
*/
- function transferEvent(address from, address to, uint256 value) external returns (bool success) {
+ function transferEvent(address payable from, address payable to, uint256 value) external returns (bool success) {
/*
Transaction completed. This function is available only for moduleHandler
If a transaction is carried out from or to an address which participated in the objection of an announcement, its objection purport is automatically set
@@ -54,14 +54,14 @@ contract publisher is announcementTypes, module, safeMath {
string _str;
uint256 _uint;
- address _addr;
+ address payable _addr;
}
mapping(uint256 => announcements_s) public announcements;
uint256 announcementsLength = 1;
mapping (address => uint256[]) public opponents;
- constructor(address moduleHandler) public {
+ constructor(address payable moduleHandler) public {
/*
Installation function. The installer will be registered in the admin list automatically
@@ -116,7 +116,7 @@ contract publisher is announcementTypes, module, safeMath {
return _amount * oppositeRate / 100 > weight;
}
- function newAnnouncement(announcementType Type, string calldata Announcement, string calldata Link, bool Oppositable, string calldata _str, uint256 _uint, address _addr) onlyOwner external {
+ function newAnnouncement(announcementType Type, string calldata Announcement, string calldata Link, bool Oppositable, string calldata _str, uint256 _uint, address payable _addr) onlyOwner external {
/*
New announcement. Can be called only by those in the admin list
diff --git a/test/compilationTests/corion/schelling.sol b/test/compilationTests/corion/schelling.sol
index e9288332..2a327ba0 100644
--- a/test/compilationTests/corion/schelling.sol
+++ b/test/compilationTests/corion/schelling.sol
@@ -133,13 +133,13 @@ contract schelling is module, announcementTypes, schellingVars {
/*
module callbacks
*/
- function replaceModule(address addr) external returns (bool) {
+ function replaceModule(address payable addr) external returns (bool) {
require( super.isModuleHandler(msg.sender) );
require( db.replaceOwner(addr) );
super._replaceModule(addr);
return true;
}
- function transferEvent(address from, address to, uint256 value) external returns (bool) {
+ function transferEvent(address payable from, address payable to, uint256 value) external returns (bool) {
/*
Transaction completed. This function can be called only by the ModuleHandler.
If this contract is the receiver, the amount will be added to the prize pool of the current round.
@@ -247,7 +247,7 @@ contract schelling is module, announcementTypes, schellingVars {
bytes1 public belowChar = 0x30;
schellingDB private db;
- constructor(address _moduleHandler, address _db, bool _forReplace) public {
+ constructor(address payable _moduleHandler, address _db, bool _forReplace) public {
/*
Installation function.
diff --git a/test/compilationTests/corion/token.sol b/test/compilationTests/corion/token.sol
index 6d3f1a1e..f55dc9e6 100644
--- a/test/compilationTests/corion/token.sol
+++ b/test/compilationTests/corion/token.sol
@@ -15,7 +15,7 @@ contract token is safeMath, module, announcementTypes {
/*
module callbacks
*/
- function replaceModule(address addr) external returns (bool success) {
+ function replaceModule(address payable addr) external returns (bool success) {
require( super.isModuleHandler(msg.sender) );
require( db.replaceOwner(addr) );
super._replaceModule(addr);
@@ -37,18 +37,18 @@ contract token is safeMath, module, announcementTypes {
uint8 public decimals = 6;
tokenDB public db;
- address public icoAddr;
+ address payable public icoAddr;
uint256 public transactionFeeRate = 20;
uint256 public transactionFeeRateM = 1e3;
uint256 public transactionFeeMin = 20000;
uint256 public transactionFeeMax = 5000000;
uint256 public transactionFeeBurn = 80;
- address public exchangeAddress;
+ address payable public exchangeAddress;
bool public isICO = true;
mapping(address => bool) public genesis;
- constructor(bool forReplace, address moduleHandler, address dbAddr, address icoContractAddr, address exchangeContractAddress, address[] memory genesisAddr, uint256[] memory genesisValue) public payable {
+ constructor(bool forReplace, address payable moduleHandler, address dbAddr, address payable icoContractAddr, address payable exchangeContractAddress, address payable[] memory genesisAddr, uint256[] memory genesisValue) public payable {
/*
Installation function