{"action":"created","comment":{"url":"https://api.github.com/repos/EOSIO/eos/pulls/comments/186304421","pull_request_review_id":117856798,"id":186304421,"diff_hunk":"@@ -120,34 +98,34 @@ namespace eosiosystem {\n          eosio_assert(now() >= prod->last_rewards_claim + seconds_per_day, \"already claimed rewards within a day\");\n       }\n \n-      /// calcualte the price-per-block \n-      \n-      /*\n-      eosio::asset rewards = prod->per_block_payments;\n-      \n-      if ( _global.exists() ) {\n-         auto parameters = _global.get();\n-         if ( parameters.eos_bucket.amount > 0 && prod->total_votes > 0 ) {\n-            eosio::asset standby_payment = payment_per_vote( owner, prod->total_votes, parameters.eos_bucket );\n-            if ( standby_payment.amount > 0 ) {\n-               rewards               += standby_payment;\n-               parameters.eos_bucket -= standby_payment;\n-               _global.set( parameters, _self );\n-            }\n-         }\n-      }\n+      auto parameters = _global.get();      \n+      const asset token_supply = token( N(eosio.token)).get_supply(symbol_type(system_token_symbol).name() );\n+      const time time_since_last_fill = now() - parameters.last_pervote_bucket_fill;\n+\n+      const asset to_eos_bucket = supply_growth( standby_rate, token_supply, time_since_last_fill );\n+      const asset to_savings    = supply_growth( continuous_rate - (perblock_rate + standby_rate), token_supply, time_since_last_fill );\n+      const asset perblock_pay  = payment_per_block( perblock_rate, token_supply, prod->produced_blocks );\n+      const asset issue_amount  = to_eos_bucket + to_savings + perblock_pay;\n       \n-      eosio_assert( rewards > asset(0, S(4,EOS)), \"no rewards available to claim\" );\n+      INLINE_ACTION_SENDER(eosio::token, issue)( N(eosio.token), {{N(eosio),N(active)}},","path":"contracts/eosio.system/producer_pay.cpp","position":114,"original_position":114,"commit_id":"58b78df628eb70f22e722569d3ddafc2fee3ab37","original_commit_id":"90297ff1c4e67207b2e4ee233dab28e4ab743c6c","user":{"login":"zorba80","id":35532164,"avatar_url":"https://avatars3.githubusercontent.com/u/35532164?v=4","gravatar_id":"","url":"https://api.github.com/users/zorba80","html_url":"https://github.com/zorba80","followers_url":"https://api.github.com/users/zorba80/followers","following_url":"https://api.github.com/users/zorba80/following{/other_user}","gists_url":"https://api.github.com/users/zorba80/gists{/gist_id}","starred_url":"https://api.github.com/users/zorba80/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zorba80/subscriptions","organizations_url":"https://api.github.com/users/zorba80/orgs","repos_url":"https://api.github.com/users/zorba80/repos","events_url":"https://api.github.com/users/zorba80/events{/privacy}","received_events_url":"https://api.github.com/users/zorba80/received_events","type":"User","site_admin":false},"body":"Changed memo","created_at":"2018-05-06T21:59:35Z","updated_at":"2018-05-06T21:59:35Z","html_url":"https://github.com/EOSIO/eos/pull/2805#discussion_r186304421","pull_request_url":"https://api.github.com/repos/EOSIO/eos/pulls/2805","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/EOSIO/eos/pulls/comments/186304421"},"html":{"href":"https://github.com/EOSIO/eos/pull/2805#discussion_r186304421"},"pull_request":{"href":"https://api.github.com/repos/EOSIO/eos/pulls/2805"}},"in_reply_to_id":186304112},"pull_request":{"url":"https://api.github.com/repos/EOSIO/eos/pulls/2805","id":186228019,"html_url":"https://github.com/EOSIO/eos/pull/2805","diff_url":"https://github.com/EOSIO/eos/pull/2805.diff","patch_url":"https://github.com/EOSIO/eos/pull/2805.patch","issue_url":"https://api.github.com/repos/EOSIO/eos/issues/2805","number":2805,"state":"open","locked":false,"title":"Move payment calculations from onblock to claimrewards ","user":{"login":"zorba80","id":35532164,"avatar_url":"https://avatars3.githubusercontent.com/u/35532164?v=4","gravatar_id":"","url":"https://api.github.com/users/zorba80","html_url":"https://github.com/zorba80","followers_url":"https://api.github.com/users/zorba80/followers","following_url":"https://api.github.com/users/zorba80/following{/other_user}","gists_url":"https://api.github.com/users/zorba80/gists{/gist_id}","starred_url":"https://api.github.com/users/zorba80/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zorba80/subscriptions","organizations_url":"https://api.github.com/users/zorba80/orgs","repos_url":"https://api.github.com/users/zorba80/repos","events_url":"https://api.github.com/users/zorba80/events{/privacy}","received_events_url":"https://api.github.com/users/zorba80/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-05-06T21:42:10Z","updated_at":"2018-05-06T21:59:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"53bdac779686aed4e41c5a63afa74bb73930a918","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/EOSIO/eos/pulls/2805/commits","review_comments_url":"https://api.github.com/repos/EOSIO/eos/pulls/2805/comments","review_comment_url":"https://api.github.com/repos/EOSIO/eos/pulls/comments{/number}","comments_url":"https://api.github.com/repos/EOSIO/eos/issues/2805/comments","statuses_url":"https://api.github.com/repos/EOSIO/eos/statuses/58b78df628eb70f22e722569d3ddafc2fee3ab37","head":{"label":"EOSIO:payment_refactor","ref":"payment_refactor","sha":"58b78df628eb70f22e722569d3ddafc2fee3ab37","user":{"login":"EOSIO","id":26932212,"avatar_url":"https://avatars2.githubusercontent.com/u/26932212?v=4","gravatar_id":"","url":"https://api.github.com/users/EOSIO","html_url":"https://github.com/EOSIO","followers_url":"https://api.github.com/users/EOSIO/followers","following_url":"https://api.github.com/users/EOSIO/following{/other_user}","gists_url":"https://api.github.com/users/EOSIO/gists{/gist_id}","starred_url":"https://api.github.com/users/EOSIO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EOSIO/subscriptions","organizations_url":"https://api.github.com/users/EOSIO/orgs","repos_url":"https://api.github.com/users/EOSIO/repos","events_url":"https://api.github.com/users/EOSIO/events{/privacy}","received_events_url":"https://api.github.com/users/EOSIO/received_events","type":"Organization","site_admin":false},"repo":{"id":87335980,"name":"eos","full_name":"EOSIO/eos","owner":{"login":"EOSIO","id":26932212,"avatar_url":"https://avatars2.githubusercontent.com/u/26932212?v=4","gravatar_id":"","url":"https://api.github.com/users/EOSIO","html_url":"https://github.com/EOSIO","followers_url":"https://api.github.com/users/EOSIO/followers","following_url":"https://api.github.com/users/EOSIO/following{/other_user}","gists_url":"https://api.github.com/users/EOSIO/gists{/gist_id}","starred_url":"https://api.github.com/users/EOSIO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EOSIO/subscriptions","organizations_url":"https://api.github.com/users/EOSIO/orgs","repos_url":"https://api.github.com/users/EOSIO/repos","events_url":"https://api.github.com/users/EOSIO/events{/privacy}","received_events_url":"https://api.github.com/users/EOSIO/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/EOSIO/eos","description":"An open source smart contract platform ","fork":false,"url":"https://api.github.com/repos/EOSIO/eos","forks_url":"https://api.github.com/repos/EOSIO/eos/forks","keys_url":"https://api.github.com/repos/EOSIO/eos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EOSIO/eos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EOSIO/eos/teams","hooks_url":"https://api.github.com/repos/EOSIO/eos/hooks","issue_events_url":"https://api.github.com/repos/EOSIO/eos/issues/events{/number}","events_url":"https://api.github.com/repos/EOSIO/eos/events","assignees_url":"https://api.github.com/repos/EOSIO/eos/assignees{/user}","branches_url":"https://api.github.com/repos/EOSIO/eos/branches{/branch}","tags_url":"https://api.github.com/repos/EOSIO/eos/tags","blobs_url":"https://api.github.com/repos/EOSIO/eos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EOSIO/eos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EOSIO/eos/git/refs{/sha}","trees_url":"https://api.github.com/repos/EOSIO/eos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EOSIO/eos/statuses/{sha}","languages_url":"https://api.github.com/repos/EOSIO/eos/languages","stargazers_url":"https://api.github.com/repos/EOSIO/eos/stargazers","contributors_url":"https://api.github.com/repos/EOSIO/eos/contributors","subscribers_url":"https://api.github.com/repos/EOSIO/eos/subscribers","subscription_url":"https://api.github.com/repos/EOSIO/eos/subscription","commits_url":"https://api.github.com/repos/EOSIO/eos/commits{/sha}","git_commits_url":"https://api.github.com/repos/EOSIO/eos/git/commits{/sha}","comments_url":"https://api.github.com/repos/EOSIO/eos/comments{/number}","issue_comment_url":"https://api.github.com/repos/EOSIO/eos/issues/comments{/number}","contents_url":"https://api.github.com/repos/EOSIO/eos/contents/{+path}","compare_url":"https://api.github.com/repos/EOSIO/eos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EOSIO/eos/merges","archive_url":"https://api.github.com/repos/EOSIO/eos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EOSIO/eos/downloads","issues_url":"https://api.github.com/repos/EOSIO/eos/issues{/number}","pulls_url":"https://api.github.com/repos/EOSIO/eos/pulls{/number}","milestones_url":"https://api.github.com/repos/EOSIO/eos/milestones{/number}","notifications_url":"https://api.github.com/repos/EOSIO/eos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EOSIO/eos/labels{/name}","releases_url":"https://api.github.com/repos/EOSIO/eos/releases{/id}","deployments_url":"https://api.github.com/repos/EOSIO/eos/deployments","created_at":"2017-04-05T17:09:53Z","updated_at":"2018-05-06T21:55:57Z","pushed_at":"2018-05-06T21:59:16Z","git_url":"git://github.com/EOSIO/eos.git","ssh_url":"git@github.com:EOSIO/eos.git","clone_url":"https://github.com/EOSIO/eos.git","svn_url":"https://github.com/EOSIO/eos","homepage":"https://eosio.github.io/eos/","size":61889,"stargazers_count":6671,"watchers_count":6671,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1591,"mirror_url":null,"archived":false,"open_issues_count":533,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":1591,"open_issues":533,"watchers":6671,"default_branch":"master"}},"base":{"label":"EOSIO:slim","ref":"slim","sha":"8d817242aa85490322e683ca306fce904a314143","user":{"login":"EOSIO","id":26932212,"avatar_url":"https://avatars2.githubusercontent.com/u/26932212?v=4","gravatar_id":"","url":"https://api.github.com/users/EOSIO","html_url":"https://github.com/EOSIO","followers_url":"https://api.github.com/users/EOSIO/followers","following_url":"https://api.github.com/users/EOSIO/following{/other_user}","gists_url":"https://api.github.com/users/EOSIO/gists{/gist_id}","starred_url":"https://api.github.com/users/EOSIO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EOSIO/subscriptions","organizations_url":"https://api.github.com/users/EOSIO/orgs","repos_url":"https://api.github.com/users/EOSIO/repos","events_url":"https://api.github.com/users/EOSIO/events{/privacy}","received_events_url":"https://api.github.com/users/EOSIO/received_events","type":"Organization","site_admin":false},"repo":{"id":87335980,"name":"eos","full_name":"EOSIO/eos","owner":{"login":"EOSIO","id":26932212,"avatar_url":"https://avatars2.githubusercontent.com/u/26932212?v=4","gravatar_id":"","url":"https://api.github.com/users/EOSIO","html_url":"https://github.com/EOSIO","followers_url":"https://api.github.com/users/EOSIO/followers","following_url":"https://api.github.com/users/EOSIO/following{/other_user}","gists_url":"https://api.github.com/users/EOSIO/gists{/gist_id}","starred_url":"https://api.github.com/users/EOSIO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EOSIO/subscriptions","organizations_url":"https://api.github.com/users/EOSIO/orgs","repos_url":"https://api.github.com/users/EOSIO/repos","events_url":"https://api.github.com/users/EOSIO/events{/privacy}","received_events_url":"https://api.github.com/users/EOSIO/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/EOSIO/eos","description":"An open source smart contract platform ","fork":false,"url":"https://api.github.com/repos/EOSIO/eos","forks_url":"https://api.github.com/repos/EOSIO/eos/forks","keys_url":"https://api.github.com/repos/EOSIO/eos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EOSIO/eos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EOSIO/eos/teams","hooks_url":"https://api.github.com/repos/EOSIO/eos/hooks","issue_events_url":"https://api.github.com/repos/EOSIO/eos/issues/events{/number}","events_url":"https://api.github.com/repos/EOSIO/eos/events","assignees_url":"https://api.github.com/repos/EOSIO/eos/assignees{/user}","branches_url":"https://api.github.com/repos/EOSIO/eos/branches{/branch}","tags_url":"https://api.github.com/repos/EOSIO/eos/tags","blobs_url":"https://api.github.com/repos/EOSIO/eos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EOSIO/eos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EOSIO/eos/git/refs{/sha}","trees_url":"https://api.github.com/repos/EOSIO/eos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EOSIO/eos/statuses/{sha}","languages_url":"https://api.github.com/repos/EOSIO/eos/languages","stargazers_url":"https://api.github.com/repos/EOSIO/eos/stargazers","contributors_url":"https://api.github.com/repos/EOSIO/eos/contributors","subscribers_url":"https://api.github.com/repos/EOSIO/eos/subscribers","subscription_url":"https://api.github.com/repos/EOSIO/eos/subscription","commits_url":"https://api.github.com/repos/EOSIO/eos/commits{/sha}","git_commits_url":"https://api.github.com/repos/EOSIO/eos/git/commits{/sha}","comments_url":"https://api.github.com/repos/EOSIO/eos/comments{/number}","issue_comment_url":"https://api.github.com/repos/EOSIO/eos/issues/comments{/number}","contents_url":"https://api.github.com/repos/EOSIO/eos/contents/{+path}","compare_url":"https://api.github.com/repos/EOSIO/eos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EOSIO/eos/merges","archive_url":"https://api.github.com/repos/EOSIO/eos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EOSIO/eos/downloads","issues_url":"https://api.github.com/repos/EOSIO/eos/issues{/number}","pulls_url":"https://api.github.com/repos/EOSIO/eos/pulls{/number}","milestones_url":"https://api.github.com/repos/EOSIO/eos/milestones{/number}","notifications_url":"https://api.github.com/repos/EOSIO/eos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EOSIO/eos/labels{/name}","releases_url":"https://api.github.com/repos/EOSIO/eos/releases{/id}","deployments_url":"https://api.github.com/repos/EOSIO/eos/deployments","created_at":"2017-04-05T17:09:53Z","updated_at":"2018-05-06T21:55:57Z","pushed_at":"2018-05-06T21:59:16Z","git_url":"git://github.com/EOSIO/eos.git","ssh_url":"git@github.com:EOSIO/eos.git","clone_url":"https://github.com/EOSIO/eos.git","svn_url":"https://github.com/EOSIO/eos","homepage":"https://eosio.github.io/eos/","size":61889,"stargazers_count":6671,"watchers_count":6671,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1591,"mirror_url":null,"archived":false,"open_issues_count":533,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":1591,"open_issues":533,"watchers":6671,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/EOSIO/eos/pulls/2805"},"html":{"href":"https://github.com/EOSIO/eos/pull/2805"},"issue":{"href":"https://api.github.com/repos/EOSIO/eos/issues/2805"},"comments":{"href":"https://api.github.com/repos/EOSIO/eos/issues/2805/comments"},"review_comments":{"href":"https://api.github.com/repos/EOSIO/eos/pulls/2805/comments"},"review_comment":{"href":"https://api.github.com/repos/EOSIO/eos/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/EOSIO/eos/pulls/2805/commits"},"statuses":{"href":"https://api.github.com/repos/EOSIO/eos/statuses/58b78df628eb70f22e722569d3ddafc2fee3ab37"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"zorba80"}}