function bet(
    uint stage,
    uint round,
    uint[] content,
    uint count,
    address recommAddr,
    bytes32 seedHash
  ) public
  payable
  verifyStage(stage)
  verifySeedHash(stage, seedHash)
  checkBetTime(stages[stage].lastTime) {
    require(stages[stage].round == round, 'Round illegal');
    require(content.length == 3, 'The bet is 3 digits');

    require((
        msg.value >= MIN_BET_MONEY
            && msg.value <= MAX_BET_MONEY
            && msg.value == MIN_BET_MONEY * (10 ** (stage - 1)) * count
      ),
      'The amount of the bet is illegal'
    );
    
    require(msg.sender != recommAddr, 'The recommender cannot be himself');
    
    if (users[msg.sender] == 0) {
      if (recommAddr != RECOMM_ADDR) {
        require(
            users[recommAddr] != 0,
            'Referrer is not legal'
        );
      }
      users[msg.sender] = recommAddr;
    }

    generateUserRelation(msg.sender, 3);
    require(userRecomms.length <= 3, 'User relationship error');

    sendInviteDividends(stage, round, count, content);

    if (!userBetAddrs[stage][stages[stage].round][msg.sender]) {
      stages[stage].userNumber++;
      userBetAddrs[stage][stages[stage].round][msg.sender] = true;
    }

    userBets[stage].push(UserBet(
      msg.sender,
      msg.value,
      content,
      count,
      now
    ));

    emit eventUserBet(
      'userBet',
      msg.sender,
      msg.value,
      stage,
      round,
      count,
      content,
      now
    );
  }