contract Grand is ERC223Token, Owned {
    string public constant name = "Grand Coin";
    string public constant symbol = "GRAND";
    uint8 public constant decimals = 18;

    uint256 public tokenRemained = 2 * (10 ** 9) * (10 ** uint(decimals)); // 2 billion Grand, decimals set to 18
    uint256 public totalSupply = 2 * (10 ** 9) * (10 ** uint(decimals));

    bool public pause = false;

    mapping(address => bool) lockAddresses;

    // constructor
    constructor () public {
        //allocate to ______
        balances[0x96F7F180C6B53e9313Dc26589739FDC8200a699f] = totalSupply;
    }

    // change the contract owner
    function changeOwner(address _new) public onlyOwner {
    	require(_new != address(0));
        owner = _new;
    }

    // pause all the g on the contract
    function pauseContract() public onlyOwner {
        pause = true;
    }

    function resumeContract() public onlyOwner {
        pause = false;
    }

    function is_contract_paused() public view returns (bool) {
        return pause;
    }

    // lock one's wallet
    function lock(address _addr) public onlyOwner {
        lockAddresses[_addr] = true;
    }

    function unlock(address _addr) public onlyOwner {
        lockAddresses[_addr] = false;
    }

    function am_I_locked(address _addr) public view returns (bool) {
        return lockAddresses[_addr];
    }

    // contract can receive eth
    function() external payable {}

    // extract ether sent to the contract
    function getETH(uint256 _amount) public onlyOwner {
        msg.sender.transfer(_amount);
    }

    /////////////////////////////////////////////////////////////////////
    ///////////////// ERC223 Standard functions /////////////////////////
    /////////////////////////////////////////////////////////////////////
    modifier transferable(address _addr) {
        require(!pause);
        require(!lockAddresses[_addr]);
        _;
    }

    function transfer(address _to, uint _value, bytes memory _data) public transferable(msg.sender) returns (bool) {
        return super.transfer(_to, _value, _data);
    }

    function transfer(address _to, uint _value) public transferable(msg.sender) returns (bool) {
        return super.transfer(_to, _value);
    }

    /////////////////////////////////////////////////////////////////////
    ///////////////////  Rescue functions  //////////////////////////////
    /////////////////////////////////////////////////////////////////////
    function transferAnyERC20Token(address _tokenAddress, uint256 _value) public onlyOwner returns (bool) {
        return ERC20(_tokenAddress).transfer(owner, _value);
    }
}
/*** @title Grand Token */
function pauseContract() public onlyOwner {
        pause = true;
    }
// pause all the g on the contract