contract InvestOnBehalf is AdminRole, Crowdsale {
    using Votings for Votings.Voting;

    // Current vote processes
    Votings.Voting private _votings;

    /**
     * Event for investOnBehalf actions logging
     * @param account Transfer target
     * @param tokens Amount of transferred tokens
     */
    event InvestedOnBehalf(address indexed account, uint256 indexed tokens);

    /**
     * @dev require (N/2)+1 admins to be agreed with the proposal
     * @param account Transfer target
     * @param tokens Amount of tokens to be transferred
     * @return do all admins agreed with the proposal?
     */
    function consensus(address account, uint256 tokens) private returns (bool) {
        return _votings.voteAndCheck(Helpers.mixId(account, tokens), msg.sender, Helpers.majority(countAdmins()));
    }


    /*
     * @dev Vote and add X tokens to the user balance after consensus
     * @param to Transfer target
     * @param tokens Amount of tokens to be transferred
     */
    function investOnBehalf(address to, uint256 tokens) AdminOnly public {
        if (consensus(to, tokens)) {
            _processPurchase(to, tokens * 1e18);
            emit InvestedOnBehalf(to, tokens * 1e18);
        }
    }
}
function consensus(address account, uint256 tokens) private returns (bool) {
    return _votings.voteAndCheck(Helpers.mixId(account, tokens), msg.sender, Helpers.majority(countAdmins()));
}

/**
 * @dev require (N/2)+1 admins to be agreed with the proposal
 * @param account Transfer target
 * @param tokens Amount of tokens to be transferred
 * @return do all admins agreed with the proposal?
 */