pragmasolidity 0.4.24;/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/contractOwnable{
addressprivate _owner;
eventOwnershipTransferred(addressindexed previousOwner,
addressindexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/constructor() internal{
_owner =msg.sender;
emit OwnershipTransferred(address(0), _owner);
}
/**
* @return the address of the owner.
*/functionowner() publicviewreturns(address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/modifieronlyOwner() {
require(isOwner());
_;
}
/**
* @return true if `msg.sender` is the owner of the contract.
*/functionisOwner() publicviewreturns(bool) {
returnmsg.sender== _owner;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/functionrenounceOwnership() publiconlyOwner{
emit OwnershipTransferred(_owner, address(0));
_owner =address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/functiontransferOwnership(address newOwner) publiconlyOwner{
_transferOwnership(newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/function_transferOwnership(address newOwner) internal{
require(newOwner !=address(0));
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
pragmasolidity 0.4.24;import"./Ownable.sol";
contractStorageV0isOwnable{
// maps functions to the delegate contracts that execute the functions// funcId => delegate contractmapping(bytes4=>address) internal delegates;
// array of function signatures supported by the contractbytes[] internal funcSignatures;
// maps each function signature to its position in the funcSignatures array.// signature => index+1mapping(bytes=>uint256) internal funcSignatureToIndex;
}
Contract Source Code
File 7 of 7: StorageV1.sol
pragmasolidity 0.4.24;import"./StorageV0.sol";
import"./IColor.sol";
import"./IPixel.sol";
contractStorageV1isStorageV0{
//pixel color(round=> pixel=> color)mapping (uint=>mapping (uint=>uint)) public pixelToColorForRound;
//old pixel color(round=> pixel=> color)mapping (uint=>mapping (uint=>uint)) public pixelToOldColorForRound;
// (round => color => pixel amount)mapping (uint=>mapping (uint=>uint)) public colorToPaintedPixelsAmountForRound;
//color bank for round (round => color bank)mapping (uint=>uint) public colorBankForRound;
//color bank for color for round (round => color => color bank)mapping (uint=>mapping (uint=>uint)) public colorBankToColorForRound;
//time bank for round (round => time bank)mapping (uint=>uint) public timeBankForRound;
// (round => timestamp)mapping (uint=>uint) public lastPaintTimeForRound;
// (round => adress)mapping (uint=>address) public lastPainterForRound;
mapping (uint=>uint) public lastPaintedPixelForRound;
// (round => color) mapping (uint=>uint) public winnerColorForRound;
// (round => color => paints amount)mapping (uint=>mapping (uint=>uint)) public colorToTotalPaintsForCBIteration;
// (round => adress)mapping (uint=>address) public winnerOfRound;
//bank drawn in round (round => drawn bank) (1 = time bank, 2 = color bank)mapping (uint=>uint) public winnerBankForRound;
mapping (uint=>mapping (uint=>uint)) public pixelToPaintTimeForRound;
mapping (uint=>uint) public totalPaintsForRound;
mapping (uint=>mapping (uint=>uint)) public paintGenToAmountForColor;
mapping (uint=>mapping (uint=>uint)) public paintGenToStartTimeForColor;
mapping (uint=>mapping (uint=>uint)) public paintGenToEndTimeForColor;
//bool mapping (uint=>mapping (uint=>bool)) public paintGenStartedForColor;
mapping (uint=>uint) public currentPaintGenForColor;
mapping (uint=>uint) public callPriceForColor;
mapping (uint=>uint) public nextCallPriceForColor;
mapping (uint=>mapping (address=>uint)) public moneySpentByUserForColor;
mapping (address=>uint) public moneySpentByUser;
mapping (uint=>mapping (address=>bool)) public hasPaintDiscountForColor;
//in percent mapping (uint=>mapping (address=>uint)) public usersPaintDiscountForColor;
mapping (address=>bool) public isRegisteredUser;
mapping (address=>bool) public hasRefLink;
mapping (address=>address) public referralToReferrer;
mapping (address=>address[]) public referrerToReferrals;
mapping (address=>bool) public hasReferrer;
mapping (address=>string) public userToRefLink;
mapping (bytes32=>address) public refLinkToUser;
mapping (bytes32=>bool) public refLinkExists;
mapping (address=>uint) public newUserToCounter;
uintpublic uniqueUsersCount;
uintpublic maxPaintsInPool;
uintpublic currentRound;
//time bank iterationuintpublic tbIteration;
//color bank iterationuintpublic cbIteration;
uintpublic paintsCounter;
//Time Bank Iteration => Painter => Painter's Share in Time Teammapping (uint=>mapping (address=>uint)) public timeBankShare;
//Color Bank Iteration => Color => Painter => Painter's Share in Time Teammapping (uint=>mapping (uint=>mapping (address=>uint))) public colorBankShare;
mapping (uint=>uint) public paintsCounterForColor;
//cbIteration => color teammapping (uint=>address[]) public cbTeam;
//tbIteration => color team mapping (uint=>address[]) public tbTeam;
//counter => usermapping (uint=>address) public counterToPainter;
//color => counter => user mapping (uint=>mapping (uint=>address)) public counterToPainterForColor;
//cbIteration => user !should not be publicmapping (uint=>mapping (address=>bool)) public isInCBT;
//tbIteration => user !should not be publicmapping (uint=>mapping (address=>bool)) public isInTBT;
//cbIteration => painter => color bank prizemapping (uint=>mapping (address=>uint)) public painterToCBP;
//tbIteration => painter => time bank prizemapping (uint=>mapping (address=>uint)) public painterToTBP;
//сbIteration => boolmapping (uint=>bool) public isCBPTransfered;
//tbIteration => boolmapping (uint=>bool) public isTBPTransfered;
mapping (address=>uint) public lastPlayedRound;
//Dividends Distributionmapping (uint=>address) public ownerOfColor;
mapping (address=>uint) public pendingWithdrawals;
// (adress => time)mapping (address=>uint) public addressToLastWithdrawalTime;
uintpublic dividendsBank;
structClaim {
uint id;
address claimer;
bool isResolved;
uint timestamp;
}
uintpublic claimId;
Claim[] public claims;
addresspublic ownerOfPixel =0xca35b7d915458ef540ade6068dfe2f44e8fa733c;
addresspublic founders =0xe04f921cf3d6c882C0FAa79d0810a50B1101e2D4;
boolpublic isGamePaused;
boolpublic isCBPDistributable;
boolpublic isTBPDistributable;
mapping(address=>bool) public isAdmin;
Color public colorInstance;
Pixel public pixelInstance;
uintpublic totalColorsNumber; // 8uintpublic totalPixelsNumber; //225 in V1uintpublic refLinkPrice;
mapping (address=>uint) public registrationTimeForUser;
mapping (address=>uint) public lastPaintTimeOfUser;
mapping (uint=>mapping (address=>uint)) public lastPaintTimeOfUserForColor;
mapping (uint=>bool) public timeBankDrawnForRound;
mapping (uint=>uint) public usersCounterForRound;
mapping (uint=>mapping (address=>bool)) public isUserCountedForRound;
// EventseventCBPDistributed(uintindexed round, uintindexed cbIteration, addressindexed winner, uint prize);
eventDividendsWithdrawn(addressindexed withdrawer, uintindexed claimId, uintindexed amount);
eventDividendsClaimed(addressindexed claimer, uintindexed claimId, uintindexed currentTime);
eventPaint(uintindexed pixelId, uint colorId, addressindexed painter, uintindexed round, uint timestamp);
eventColorBankPlayed(address winnerOfRound, uintindexed round);
eventTimeBankPlayed(address winnerOfRound, uintindexed round);
eventCallPriceUpdated(uintindexed newCallPrice);
eventTBPDistributed(uintindexed round, uintindexed tbIteration, addressindexed winner, uint prize);
eventEtherWithdrawn(uint balance, uint colorBank, uint timeBank, uint timestamp);
}