contract TocIcoData{
/////////////////////////////////////////////////////////    
///////(c)2017 tokenchanger.io -all rights reserved////// 
 
/*SUPER ADMINS*/
address Mars = 0x1947f347B6ECf1C3D7e1A58E3CDB2A15639D48Be;
address Mercury = 0x00795263bdca13104309Db70c11E8404f81576BE;
address Europa = 0x00e4E3eac5b520BCa1030709a5f6f3dC8B9e1C37;
address Jupiter = 0x2C76F260707672e240DC639e5C9C62efAfB59867;
address Neptune = 0xEB04E1545a488A5018d2b5844F564135211d3696;

/*CONTRACT ADDRESS*/
function GetContractAddr() public constant returns (address){
return this;
}	
address ContractAddr = GetContractAddr();

struct State{
bool Suspend;    
bool PrivateSale;
bool PreSale;
bool MainSale; 
bool End;
}

struct Market{
uint256 EtherPrice;    
uint256 TocPrice;    
} 

struct Admin{
bool Authorised; 
uint256 Level;
}

/*contract state*/
mapping (address => State) public state;
/*market storage*/
mapping (address => Market) public market;
/*authorised admins*/
mapping (address => Admin) public admin;

/*AUTHORISE ADMIN*/
function AuthAdmin(address _admin, bool _authority, uint256 _level) external 
returns(bool) {
if((msg.sender != Mars) && (msg.sender != Mercury) && (msg.sender != Europa)
&& (msg.sender != Jupiter) && (msg.sender != Neptune)) revert();  
admin[_admin].Authorised = _authority; 
admin[_admin].Level = _level;
return true;
} 

/*GENERAL PRICE UPDATE*/
function GeneralUpdate(uint256 _etherprice, uint256 _tocprice) external returns(bool){
/*integrity checks*/    
if(admin[msg.sender].Authorised == false) revert();
if(admin[msg.sender].Level < 5 ) revert();
/*update market record*/
market[ContractAddr].EtherPrice = _etherprice; 
market[ContractAddr].TocPrice = _tocprice;
return true;
}

/*UPDATE ETHER PRICE*/
function EtherPriceUpdate(uint256 _etherprice)external returns(bool){
/*integrity checks*/    
if(admin[msg.sender].Authorised == false) revert();
if(admin[msg.sender].Level < 5 ) revert();
/*update market record*/
market[ContractAddr].EtherPrice = _etherprice; 
return true;
}

/*UPDATE STATE*/
function UpdateState(uint256 _state) external returns(bool){
/*integrity checks*/    
if(admin[msg.sender].Authorised == false) revert();
if(admin[msg.sender].Level < 5 ) revert();
/*suspend sale state*/
if(_state == 1){
state[ContractAddr].Suspend = true;     
state[ContractAddr].PrivateSale = false; 
state[ContractAddr].PreSale = false;
state[ContractAddr].MainSale = false;
state[ContractAddr].End = false;
}
/*private sale state*/
if(_state == 2){
state[ContractAddr].Suspend = false;     
state[ContractAddr].PrivateSale = true; 
state[ContractAddr].PreSale = false;
state[ContractAddr].MainSale = false;
state[ContractAddr].End = false;
}
/*presale state*/
if(_state == 3){
state[ContractAddr].Suspend = false;    
state[ContractAddr].PrivateSale = false; 
state[ContractAddr].PreSale = true;
state[ContractAddr].MainSale = false;
state[ContractAddr].End = false;
}
/*main sale state*/
if(_state == 4){
state[ContractAddr].Suspend = false;    
state[ContractAddr].PrivateSale = false; 
state[ContractAddr].PreSale = false;
state[ContractAddr].MainSale = true;
state[ContractAddr].End = false;
}
/*end state*/
if(_state == 5){
state[ContractAddr].Suspend = false;    
state[ContractAddr].PrivateSale = false; 
state[ContractAddr].PreSale = false;
state[ContractAddr].MainSale = false;
state[ContractAddr].End = true;
}
return true;
}

/*GETTERS*/

/*get suspend state*/
function GetSuspend() public view returns (bool){
return state[ContractAddr].Suspend;
}
/*get private sale state*/
function GetPrivateSale() public view returns (bool){
return state[ContractAddr].PrivateSale;
}
/*get pre sale state*/
function GetPreSale() public view returns (bool){
return state[ContractAddr].PreSale;
}
/*get main sale state*/
function GetMainSale() public view returns (bool){
return state[ContractAddr].MainSale;
}
/*get end state*/
function GetEnd() public view returns (bool){
return state[ContractAddr].End;
}
/*get ether price*/
function GetEtherPrice() public view returns (uint256){
return market[ContractAddr].EtherPrice;
}
/*get toc price*/
function GetTocPrice() public view returns (uint256){
return market[ContractAddr].TocPrice;
}

}
function AuthAdmin(address _admin, bool _authority, uint256 _level) external 
returns(bool) {
if((msg.sender != Mars) && (msg.sender != Mercury) && (msg.sender != Europa)
&& (msg.sender != Jupiter) && (msg.sender != Neptune)) revert();  
admin[_admin].Authorised = _authority; 
admin[_admin].Level = _level;
return true;
} 

/*AUTHORISE ADMIN*/