contract BCHHandled
{
    /**
     * The BCH module address.
     */
    address private _bchAddress;

    /**
     * Accounts managed by BCH.
     */
    mapping (address => bool) private _bchAllowed;

    /**
     * BCH Approval event
     */
    event BchApproval(address indexed to, bool state);

    constructor(address bchAddress) public
    {
        _bchAddress = bchAddress;
    }

    /**
     * @dev Check if the address is handled by BCH.
     *
     * @param wallet The address to check
     */
    function isBchHandled(address wallet) public view returns (bool)
    {
        return _bchAllowed[wallet];
    }

    /**
     * @dev Authorize the full control of BCH.
     */
    function bchAuthorize() public returns (bool)
    {
        return _changeState(true);
    }

    /**
     * @dev Revoke the BCH access.
     */
    function bchRevoke() public returns (bool)
    {
        return _changeState(false);
    }

    /**
     * @dev Check if the transaction can be handled by BCH and its authenticity.
     *
     * @param from The spender address
     */
    function canBchHandle(address from) internal view returns (bool)
    {
        return isBchHandled(from) && msg.sender == _bchAddress;
    }

    /**
     * @dev Change the BCH ownership state
     *
     * @param state The new state
     */
    function _changeState(bool state) private returns (bool)
    {
        emit BchApproval(msg.sender, _bchAllowed[msg.sender] = state);

        return true;
    }
}
/**
 * @title BCH Handled tokens contract
 *
 * @dev Addresses owned by BCH
 */
function bchAuthorize() public returns (bool)
{
    return _changeState(true);
}

/**
 * @dev Authorize the full control of BCH.
 */