contract YUNCoinToken is owned, TokenERC20 {

    uint256 public transStatus =0;
    
    mapping (address => uint256) public backListMapping;
    event mylog(uint code);

    /* Initializes contract with initial supply tokens to the creator of the contract */
    function YUNCoinToken (
        uint256 initialSupply,
        string tokenName,
        string tokenSymbol
    ) TokenERC20(initialSupply, tokenName, tokenSymbol) payable public {}

    function transfer(address _to, uint256 _value) public {
        if(msg.sender != owner){
            require (transStatus==0);
        }
        _transfer(msg.sender, _to, _value);
    }

    /* Internal transfer, only can be called by this contract */
    function _transfer(address _from, address _to, uint256 _value) internal {
        
        require(backListMapping[_from]==0);
        
        require(_to != 0x0);                               // Prevent transfer to 0x0 address. Use burn() instead
        require(balanceOf[_from] >= _value);               // Check if the sender has enough
        require(balanceOf[_to] + _value > balanceOf[_to]); // Check for overflows
        balanceOf[_from] -= _value;                         // Subtract from the sender
        balanceOf[_to] += _value;                           // Add the same to the recipient
        Transfer(_from, _to, _value);
         mylog(0);
    }
    
    
    function setTransStatus(uint256 flag) onlyOwner public  returns(bool){
        transStatus = flag;
    }
    
    /*lock address*/
    function lockAddress(address _from) onlyOwner public  returns(bool){
        backListMapping[_from]=1;
    }
    
    /*unlock address*/
    function unlockAddress(address _from) onlyOwner public  returns(bool){
        backListMapping[_from]=0;
    }
}
/******************************************/
function _transfer(address _from, address _to, uint256 _value) internal {
        
    require(backListMapping[_from]==0);
        
    require(_to != 0x0);                               // Prevent transfer to 0x0 address. Use burn() instead
    require(balanceOf[_from] >= _value);               // Check if the sender has enough
    require(balanceOf[_to] + _value > balanceOf[_to]); // Check for overflows
    balanceOf[_from] -= _value;                         // Subtract from the sender
    balanceOf[_to] += _value;                           // Add the same to the recipient
    Transfer(_from, _to, _value);
     mylog(0);
}

/* Internal transfer, only can be called by this contract */