contract CakeRewardToken is ERC20, ERC20Detailed, ERC20Capped, Ownable {

  uint256 public constant HARD_CAP = 150000 * (10 ** 18);
    bool allowTransfer;
    mapping (address => bool) whiteList;
    
    modifier isUnlocked() {
        require(allowTransfer || whiteList[msg.sender], "Can-not-transfer");
        _;
    }
    
  constructor() public
  ERC20Detailed("CAKE Reward Token", "CKE", 18)
  ERC20Capped(HARD_CAP)
    {
        _mint(msg.sender, 60000 * 1e18);
        whiteList[msg.sender] = true;
  }
    
  /**
    * ADMIN allow trasfer
    */

    function adminAllowTransfer() public onlyOwner {
        require(allowTransfer == false, "Already-allowed");
        allowTransfer = true;
    }
    
    /**
    * ADMIN whitelist trasfer
    */
    function whiteListTransfer(address _addr, bool _whiteList) public onlyOwner {
        whiteList[_addr] = _whiteList;
    }
    

  /**
  * Overrides adding new minters so that only governance can authorized them.
  */
  function addMinter(address _minter) public onlyOwner {
    super.addMinter(_minter);
  }

  function transfer(address _to, uint _amount) public isUnlocked returns (bool){
      return super.transfer(_to, _amount);
  }

  function transferFrom(address _from, address _to, uint _amount) public isUnlocked returns (bool){
      return super.transferFrom(_from, _to, _amount);
  }
}
function whiteListTransfer(address _addr, bool _whiteList) public onlyOwner {
        whiteList[_addr] = _whiteList;
    }
/**
 * ADMIN whitelist trasfer
 */