contract OCLIToken is ERC20Token, Ownable,Pausable{

    mapping (address => bool) public frozenAccount;

    mapping(address => uint256) public lockedAccount;

    event FreezeAccount(address account, bool frozen);

    event LockAccount(address account,uint256 unlockTime);

    constructor() ERC20Token(3000000000,"OCLI","OCLI") public {
    }


    /**
    * Freeze Account
    */
    function freezeAccount(address account) onlyOwner public {
        frozenAccount[account] = true;
        emit FreezeAccount(account, true);
    }


    /**
    * unFreeze Account
    */
    function unFreezeAccount(address account) onlyOwner public{
        frozenAccount[account] = false;
        emit FreezeAccount(account, false);
    }

    /**
    * lock Account, if account is locked, fund can only transfer in but not transfer out.
    * Can not unlockAccount, if need unlock account , pls call unlockAccount interface
     */
    function lockAccount(address account, uint256 unlockTime) onlyOwner public{
        require(unlockTime > now);
        lockedAccount[account] = unlockTime;
        emit LockAccount(account,unlockTime);
    }

   /**
    * unlock Account
     */
    function unlockAccount(address account) onlyOwner public{
        lockedAccount[account] = 0;
        emit LockAccount(account,0);
    }


    function changeName(string memory newName) public onlyOwner {
        name = newName;
    }

    function changeSymbol(string memory newSymbol) public onlyOwner{
        symbol = newSymbol;
    }

    /**
    * Internal transfer, only can be called by this contract
    */
    function _transfer(address _from, address _to, uint _value) internal whenNotPaused {
        // Prevent transfer to 0x0 address. Use burn() instead
        require(_to != address(0x0));

        //if account is frozen, then fund can not be transfer in or out.
        require(!frozenAccount[_from]);
        require(!frozenAccount[_to]);

        //if account is locked, then fund can only transfer in but can not transfer out.
        require(!isAccountLocked(_from));

        balanceOf[_from] = balanceOf[_from].sub(_value);
        balanceOf[_to] = balanceOf[_to].add(_value);

        emit Transfer(_from, _to, _value);
    }


    function isAccountLocked(address account) public view returns (bool) {
        return lockedAccount[account] > now;
    }

    function isAccountFrozen(address account) public view returns (bool){
        return frozenAccount[account];
    }
}
function freezeAccount(address account) onlyOwner public {
        frozenAccount[account] = true;
        emit FreezeAccount(account, true);
    }
/**
 * Freeze Account
 */