Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Community Request - Reward Beneficiaries should be paid based on payout setting #2022

Closed
TimCliff opened this Issue Jan 22, 2018 · 7 comments

Comments

Projects
7 participants
@TimCliff
Copy link
Contributor

commented Jan 22, 2018

Currently if an author chooses 50/50 rewards for their post/comment, and they include beneficiaries, the beneficiaries do not receive their rewards as 50/50. This should be updated so that the beneficiaries payout is the same as the author’s.

@joticajulian

This comment has been minimized.

Copy link

commented Jan 22, 2018

Yes, I agree. To be fair, also curators should receive it in 50/50. Because currently, with the high prices of sbd, the authors are receiving around 92% of the total payment (see my proposal and math details).

@Zappl

This comment has been minimized.

Copy link

commented Jan 23, 2018

We at Zappl also Support's this idea as well. Currently, for new platform developers, 13 weeks power down is going to be hard on paying server bills or developers if you're not popular with the Steem community. Lucky enough most of us devs have good communities but the current distribution of payment for Beneficiaries is enough to not want to make a project.

It's not really clear to developers how much they can't depend on post rewards from their users. Considering most projects make a large number of their earnings from their own update posts.

Even 25/75 is okay in our eyes.

@hrosspet

This comment has been minimized.

Copy link

commented Mar 12, 2018

I agree beneficiary's payout should follow if the author chooses 50% SBD / 50% SP.

@mvandeberg : any updates if this has been discussed at steemit team?

@TimCliff

This comment has been minimized.

Copy link
Contributor Author

commented May 14, 2018

I propose the following changes to update the beneficiaries payout to use the same payout setting as the comment author:

In libraries/protocol/hardfork.d/0_20.hf, add a new HF20 condition:

#define STEEM_HARDFORK_0_20__2022 (STEEM_HARDFORK_0_20)

In libraries/chain/database.cpp, inside the cashout_comment_helper method, update the beneficiaries payout to give the same portion of rewards in SP/SBD/STEEM as the author payout:

            for( auto& b : comment.beneficiaries )
            {
               auto benefactor_tokens = ( author_tokens * b.weight ) / STEEM_100_PERCENT;

               if( has_hardfork( STEEM_HARDFORK_0_20__2022 ) )
               {
                              auto benefactor_sbd_steem     = ( benefactor_tokens * comment.percent_steem_dollars ) / ( 2 * STEEM_100_PERCENT ) ;
                              auto benefactor_vesting_steem = benefactor_tokens - benefactor_sbd_steem;
                              auto vest_created = create_vesting( get_account( b.account ), asset( benefactor_vesting_steem, STEEM_SYMBOL ), true );
                              auto sbd_payout = create_sbd( get_account( b.account ), asset( benefactor_sbd_steem, STEEM_SYMBOL ), true );
               }
               else
               {
                              auto vest_created = create_vesting( get_account( b.account ), asset( benefactor_tokens, STEEM_SYMBOL ), has_hardfork( STEEM_HARDFORK_0_17__659 ) );
               }

               push_virtual_operation( comment_benefactor_reward_operation( b.account, comment.author, to_string( comment.permlink ), vest_created ) );
               total_beneficiary += benefactor_tokens;
            }

I am unsure what to do about the comment_benefactor_reward_operation virtual operation yet. This would need to be updated in order to include the sbd_payout values in addition to the vest_created amount. There doesn't really seem to be a way to do this conditionally based on the hardfork condition without creating a new virtual operation. Updating the existing virtual operation in place would change the definition of the operation even for pre-hardfork values for any nodes that were running the new code. Are there any examples of how this has been done in the past?

@mvandeberg

This comment has been minimized.

Copy link
Contributor

commented May 14, 2018

Virtual ops are non-consensus and can change.

@TimCliff

This comment has been minimized.

Copy link
Contributor Author

commented May 22, 2018

The following changes would need to be made to update the comment_benefactor_reward_operation virtual operation:

In libraries/protocol/include/steem/protocol/steem_virtual_operations.hpp, update the struct to contain the SBD payout information:

   struct comment_benefactor_reward_operation : public virtual_operation
   {
      comment_benefactor_reward_operation() {}
      comment_benefactor_reward_operation( const account_name_type& b, const account_name_type& a, const string& p, const asset& s, const asset& st, const asset& v )
         : benefactor( b ), author( a ), permlink( p ), sbd_payout( s ), steem_payout( st ), vesting_payout( v ) {}

      account_name_type benefactor;
      account_name_type author;
      string            permlink;
      asset             sbd_payout;
      asset             steem_payout;
      asset             vesting_payout;
   };
FC_REFLECT( steem::protocol::comment_benefactor_reward_operation, (benefactor)(author)(permlink)(sbd_payout)(steem_payout)(vesting_payout) )

In libraries/chain/database.cpp, update the call to push_virtual_operation to include the new information:

In the pre-hf20 block:

push_virtual_operation( comment_benefactor_reward_operation( b.account, comment.author, to_string( comment.permlink ), asset( 0, SBD_SYMBOL ), asset( 0, STEEM_SYMBOL ), vest_created ) );

In the post-hf20 block:

push_virtual_operation( comment_benefactor_reward_operation( b.account, comment.author, to_string( comment.permlink ), sbd_payout.first, sbd_payout.second, vest_created ) );

For the legacy_comment_benefactor_reward_operation virtual operation in libraries/plugins/apis/condenser_api/include/steem/plugins/condenser_api/condenser_api_legacy_operations.hpp, it is unclear what the best path forward is. One option is to keep the virtual operation structurally the same, and just ignore the sbd_payout options. A second option is to update it to be consistent with the changes to comment_benefactor_reward_operation. I lean towards the second option if there are no reasons to keep it the same.

Option 1 (keep it structurally the same):

   struct legacy_comment_benefactor_reward_operation
   {
      legacy_comment_benefactor_reward_operation() {}
      legacy_comment_benefactor_reward_operation( const comment_benefactor_reward_operation& op ) :
         benefactor( op.benefactor ),
         author( op.author ),
         permlink( op.permlink ),
         reward( legacy_asset::from_asset( op.vesting_payout ) )
      {}

      operator comment_benefactor_reward_operation()const
      {
         comment_benefactor_reward_operation op;
         op.benefactor = benefactor;
         op.author = author;
         op.permlink = permlink;
         op.reward = reward;
         return op;
      }

      account_name_type benefactor;
      account_name_type author;
      string            permlink;
      legacy_asset      reward;
   };

Option 2 (update it to match the non-legacy version):

   struct legacy_comment_benefactor_reward_operation
   {
      legacy_comment_benefactor_reward_operation() {}
      legacy_comment_benefactor_reward_operation( const comment_benefactor_reward_operation& op ) :
         benefactor( op.benefactor ),
         author( op.author ),
         permlink( op.permlink ),
         sbd_payout( legacy_asset::from_asset( op.sbd_payout ) ),
         steem_payout( legacy_asset::from_asset( op.steem_payout ) ),
         vesting_payout( legacy_asset::from_asset( op.vesting_payout ) )
      {}

      operator comment_benefactor_reward_operation()const
      {
         comment_benefactor_reward_operation op;
         op.benefactor = benefactor;
         op.author = author;
         op.permlink = permlink;
         op.sbd_payout = sbd_payout;
         op.steem_payout = steem_payout;
         op.vesting_payout = vesting_payout;
         return op;
      }

      account_name_type benefactor;
      account_name_type author;
      string            permlink;
      legacy_asset      sbd_payout;
      legacy_asset      steem_payout;
      legacy_asset      vesting_payout;
   };
FC_REFLECT( steem::plugins::condenser_api::legacy_comment_benefactor_reward_operation, (benefactor)(author)(permlink)(sbd_payout)(steem_payout)(vesting_payout) )

TimCliff added a commit to TimCliff/steem that referenced this issue Jun 5, 2018

TimCliff added a commit to TimCliff/steem that referenced this issue Jun 5, 2018

@mac128k mac128k added this to Backlog (not prioritized) in Hardfork 20 (HF20/Velocity) Jun 27, 2018

@mac128k mac128k added the 1 label Jul 5, 2018

TimCliff added a commit to TimCliff/steem that referenced this issue Jul 8, 2018

TimCliff added a commit to TimCliff/steem that referenced this issue Jul 8, 2018

mvandeberg added a commit that referenced this issue Jul 9, 2018

Merge pull request #2555 from TimCliff/2022-sbd-beneficiaries
Closes #2022 - Add beneficiaries SBD payout

TimCliff added a commit to TimCliff/steem that referenced this issue Jul 9, 2018

TimCliff added a commit to TimCliff/steem that referenced this issue Jul 10, 2018

mvandeberg added a commit that referenced this issue Jul 10, 2018

@mvandeberg mvandeberg closed this Jul 11, 2018

@mvandeberg

This comment has been minimized.

Copy link
Contributor

commented Jul 11, 2018

Should not have closed this. It is still in review.

@mvandeberg mvandeberg reopened this Jul 11, 2018

mvandeberg added a commit that referenced this issue Jul 17, 2018

Merge pull request #2610 from steemit/2555-PR
Closes #2022 - Add beneficiaries SBD payout

@mvandeberg mvandeberg closed this Jul 17, 2018

@mac128k mac128k moved this from Backlog (not prioritized) to Done in Hardfork 20 (HF20/Velocity) Jul 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.