HiveDownvoteRewards (HDR) Progress Report #1

    This is the first section of our new approval function. Also, check out this concept art I slapped together.

image.png

    I wanted to see how everybody felt about having an Asian Giant Hornet for a new mascot. I think it's the perfect addition to 2020. 😉

Stay away Murder Hornets. Stay away. 😒

I'm no artist but maybe I can see if @overkillcoin is interesting in another commision using this concept.

I will split it apart in several sections to explain the design.

Section 1 Prechecks

    This section performs a few prerequisite checks before querying the chain for eligle downvotes.

@bot.command()
async def approve(ctx, link):
    """Checks post body for @hive-dr mention and https://hive.blog and must be in the flag_comment_review
    channel id """
    try:
        if not mod_check(ctx.author.roles):
            await ctx.send('Must be an HDR Moderator or Admin to run this command.')
            return
        #obtains mods steem account based on pairing in config file and splits our username from single quotes
        approving_mod_hive_acct = 'hive-dr'
        for item in cfg.Moderators:
            if item['DiscordID'] == ctx.author.id:
                approving_mod_hive_acct = item['HiveUserName']
        await ctx.send("Approving mod's Hive Account identified as "+approving_mod_hive_acct+"!")
        print(approving_mod_hive_acct)
        if ctx.message.channel.id != cfg.FLAG_APPROVAL_CHANNEL_ID:
            await ctx.send('Send commands in the right channel please.')
            return
        logging.info('Registered command for {} by {}'.format(link, ctx.message.author.name))
        comment_perm = link.split('@')[-1]
        try:
            flaggers_comment = Comment(comment_perm, steem_instance=hive)
        except ContentDoesNotExistsException:
            await ctx.send('Please look at your link again. Could not find the linked comment.')
            return
        flagger = Account(flaggers_comment['author'])
        hdr = Account(cfg.HDRACCOUNT, steem_instance=hive)
        hdrt = Account(cfg.HDRTACCOUNT, steem_instance=hive)
        if '@{}'.format('https://hive.blog') not in flaggers_comment['body'].lower():
            await ctx.send("Could not find a @%s mention. Please check "
                           "the comment." % (cfg.HDRACCOUNT))
            return
        cats = get_abuse_categories(flaggers_comment['body'])
        if len(cats) == 0:
            await ctx.send('No abuse category found.')
            return
        await ctx.send('Abuse category acknowledged as {}'.format(', '.join(cats)))
        parent_perm = construct_authorperm(flaggers_comment['parent_author'],
                                           flaggers_comment['parent_permlink'])
        flagged_post = Comment(parent_perm, steem_instance=hive)
        if '@{}'.format('https://hive.blog') not in flaggers_comment['body'].lower():            
            await ctx.send("Could not find a @%s mention. Please check the comment." % (cfg.HDRACCOUNT))            
            return
        logging.info(f'Flagged post: {flagged_post.authorperm}')
        weight = 0
        if flagged_post.is_pending(): # to ensure flags are final, check if flagged post is pending payout
            await ctx.send("This post is still pending. Try again later!")
            return

Section 2 Downvote Query / Credit / Update DB

  This section queries, credits, and updates the database. Once the downvoted post reaches payout, a flagger may leave a mention for the downvotes to be processed and paid.

    The reporting flag receives a ROI bonus so there is an incentive to be the one to do it. Downvotes will be credited within the approval workflow which is a change from the clunky daily distribution model from before. Expect a significant performance increase.

        dv_list = []
        dv_count = 0
        global distributions = [] #HDR distributions
        for v in flagged_post['active_votes']:
            if int(v['rshares']) < 0 and v['voter'] == flagger['name']:
                dv_count += 1
                await ctx.send(str(dv_count)+'Downvote(s) Detected')
                hdrdvote = v
                ROI = cfg.ROI
                ROI += cfg.new_flag_ROI
                if not cursor.execute('SELECT flagger FROM steemflagrewards WHERE flagger == ?;', (flagger['name'],)): #check to see if it is flaggers first HDR flag
                    ROI += cfg.first_flag_ROI
                weight = calculate_weight(v,ROI)
                if not check_db(flaggers_comment):
                    await ctx.send("Crediting "+flagger['name']+"'s downvote HDR")
                    stu = hive.rshares_to_sbd(abs(int(v['rshares'])))
                    payout_stu = Decimal(max(round(stu,3),0.001))
                    tx = hive_eng.send_token('HDR', 'hdr-treasury', flagger['name'], payout_stu, 'HDR Flag Payout for @'+flagged_post.author+'/'+flagged_post.permlink)
                    dist_dict = {'Payeee': flagger['name'], 'Amount': payout_stu, 'TX': tx.id}
                    distributions += dist_dict
                    insert_mention(approving_mod_hive_acct,cats,False,flagger['name'], flaggers_comment,flagged_post, hdrdvote, weight, False)
                    db.commit()
                    await ctx.send("Added "+flagger['name']+"'s flag to database")
            if int(v['rshares']) < 0 and v['voter'] != flagger['name']:
                dv_count += 1
                await ctx.send(str(dv_count)+'Downvote(s) Detected')
                ROI = cfg.ROI
                if not cursor.execute('SELECT flagger FROM hdr WHERE flagger == ?;', (flagger['name'],)): #check to see if it is flaggers first HDR flag
                    ROI += cfg.first_flag_ROI
                weight = calculate_weight(v,ROI)
                if(flag_exists(q[0],flagger)):
                    continue
                await ctx.send("Crediting "+flagger['name']+"'s downvote HDR")
                stu = hive.rshares_to_sbd(abs(int(v['rshares'])))
                dist_dict = {'Payee': pay['flagger'], 'Amount': payout_stu, 'TX': tx.id
                distributions += dist_dict
                payout_stu = Decimal(max(round(stu,3),0.001))
                tx = hive_eng.send_token('HDR', 'hdr-treasury', flagger['name'], payout_stu, 'HDR Flag Payout for @'+flagged_post.author+'/'+flagged_post.permlink)
                insert_mention(approving_mod_hive_acct,cats,False,flagger['name'],None, flagged_post, v, weight,False)
        if not weight:
            print(weight)
            await ctx.send('Apparently, the post wasn\'t flagged!')
            return
        else:
            await ctx.send("Flag already in database")
        body = get_approval_comment_body(flaggers_comment['author'], cats,False)
        hive.post('', body, #Leave Downvote Approval Comment
                reply_identifier=flaggers_comment['authorperm'],
                community='HDR', parse_body=True,
                author=hdr.name)
        await ctx.send('Commented.')

Section 3 Bonus Curation

If there is excess VP, reporting comment will be upvoted nominally. This will be a bonus to the existing moderation incentive and serve to optimize voting power.

        if hdr.vp > 98:
            min_vote_pct = hive.rshares_to_vote_pct(0.0245 / hive.get_sbd_per_rshares(),
                                                   hive_power=hdr.sp,
                                                   voting_power=hdr.vp)
            for curator in cfg.CURATORS:
                curator_account = Account(curator,steem_instance=hive)
                if curator_account.vp > 90:
                    flaggers_comment.upvote(weight=3,voter=curator)
            flaggers_comment.upvote(weight=round((min_vote_pct*3) / 10000),voter=cfg.SFRACCOUNT)

Section 4 New Flag Report

    This report will be generated as a post is approved providing an audit log of token transactions for users. Ideally, we will want to move this functionality to a proper front end which will be something that I work on as my schedule permits.

        if distributions:
            tr = payout_report(distributions)
            msg = 'Sucessfully posted a new Token Distribution report! Check it out! (And upvote it as well :P)\nhttps://hive.blog/{}'.format(
                r)
            await ctx.send(msg)
            postpromo = bot.get_channel(cfg.POST_PROMOTION_CHANNEL_ID)
            await postpromo.send(msg)
        hdr.claim_reward_balance()
        hdr.refresh()
        hdrt.refresh()
    except OSError as e:
        print(e)
        bot.clear()...

    The approval mechanism has arguably been one of the most convoluted. The new approach intends to streamline the process. THe next step will be for us to resolve dependencies in the parent script but hopefully with this post you have a better idea of where I am going with things.

Sort:  

Woohoo! Movement in the wires!

I think the murder hornet is a great mascot.

cool, good job!

sad I can't participate

Thanks!

How come?

was banned from HDR discord

Ahhh I meant to fix that sooner. You should be good now.

I love the Option of Downvoting, becouse we do not live just in a happy shining World. The truth is, the bad side, will be not be seeing enought, that demage us all with the time.

You go a way, ( i hope i undestand it right) i am with you. Hope that will beeing changed the mind´s of the mass people who be scared of downvotings.

Salve
Alucian

This is precisely what the project had encouraged in the past on Steem and hope to repeat on Hive.

I was considering how dire circumstances could become if those whose intent was to take through any means possible were to become a prevailing force. 🤔

When we promote broad self-policing and work together, this greatly reduces any bad actor ability to gain a foothold.

Of course, they could always buy the Hive on the market but, with skin in the game, incentive to not turn the platform into a spammy pile of something should be present.

Some people just need a little extra learning. Hopefully, we can be there to provide.

If you make it possible to put your project in the hands of at least a second person in order to "guarantee" the bus accident phenomenon and thus the consistency, I would coordinate with my team to promote your work over time through our project.

However, we have to be very careful with this, because a shitstorm has often happened because of downvotes.

My support is privately assured as far as you are concerned.

Greets

Alucian

Wow. That means a lot and promotion / marketing are two areas we could probably use support. I've come to realize one guy as a hobby can only do so much and it is important for people to stay in the lane of their abilities.

It was recommended we go with a multisig account but it will be necessary to plot out a continuity plan in case of an out of control bus or unexpected piano falling from the sky!😱

Once things are in full swing, think you will be pleased with the results. As for the shitstorms, I've weathered a few of them my time on the chain but have a partner of ours in mind to help counter them. Have them in mind for our proposal.

Sorry for my late answer!!! But i thought i aswered you.

I do not think, i am a high influence man in the moment, but it looks good, to change this in the near future. Becouse i able to spend more time here on the chain and i like communication, too. So, we can work as one and make a good job.

It was recommended we go with a multisig account but it will be necessary to plot out a continuity plan in case of an out of control bus or unexpected piano falling from the sky!😱

With time and growing confidence, we can work together to further decentralize our projects, which for me fit together well in the spirit of their purpose. Let's see what time says and hope that we will each be spared a piano. :-)

After what little I have seen of you, I definitely agree with you about the satisfaction behind. The soul behind it seems to me, by gut instinct, to be the right one, to be supported and respected.

I still have my first shit storm ahead of me, but I am prepared to take it as a natural fact. Good that you have experience with it, so maybe I can learn something from it.

Having good supporters behind your project is very important and sounds reasonable. I have talked to my partner and it is definitely up for discussion. For the time being we will of course continue to focus on our project so that it can finally become active as originally conceived. On the positive side, you are only the second people we would consider working with.

The list of like-minded people may be short, but once you have found each other, it should become something in the future. If there is anything that can help you, don't be afraid to ask.

Best regards

Sascha

....I think it's missing something, like the hypnotizing neon flashing lights and the easy on the eyes aspect, otherwise reading this is a snoozer.

Haha thank you for your brutal honesty as always. These posts are not so much designed for entertainment I am afraid just to reflect that work is, in fact, being done for my fellow vigilante friends.

I think playing some Jackbox with y'all would be much more fun than coding any day of the week. Maybe, I'll host a game soon on stream. Tbh coding is a necessary evil. One I do not enjoy probably at all.

Found your mention so I thought I'd say hi. I deleted all my socials again. Except Telegram which I barely use. Hope you're doing well.

@anthonyadavisii, Hope that this Model will going to bring in change wherever it's needed in the Spam and related areas.

Good wishes from my side and stay blessed always.

Thank you, sir. It is definitely one monkey I will be happy to get off my back while at the same time serving greater good.

Appreciate the kind words.

Welcome and thank you.

It's good that this is being worked on before the abuse gets too bad. I think people will thank you later. One guys influence does not have to determine whether we can act.

I hear ya about not letting him decide but time is a precious thing so I'm not really diggin' him making it less worth my time.

It was never a lucrative venture but if I can at least make the convergent curve on a dev post reflective of hours of work. I would be content w that.

I mean I hardly ever make the curve and will keep going but zero is just a blatant slap in the face.

Maybe do some posts on a different topic that some of us can vote up.

💪

Thanks!

I noticed that the at biggest abuser of the platform doesn't like this post. This means you are doing well!

The problem is, regardless of how I feel about how he can be towards ppl, the artist formerly known as BernieSanders has the stake to decide whether this project can continue.

That's the truth so hoping he can seek to understand precisely what it is we are intending to do as what he would dismiss as mere group flagging.

The ironic part is his drastic adjustment to zero (thankfully the people were kind enough to redeem it) is that it speaks to why group flags have value.

When people flag as a group, there is consensus among them whereas individual flags can merely be products of personal biases which isn't really the best imho

100% agree

Yay!
Your post has been boosted with Ecency Points. Keep up the good work!
Dear reader, Install Android: https://android.ecency.com, iOS: https://ios.ecency.com mobile app or desktop app for Windows, Mac, Linux: https://desktop.ecency.com
Learn more: https://ecency.com
Join our discord: https://discord.me/ecency

Eagerly waiting for it!