{"action":"created","comment":{"url":"https://api.github.com/repos/AugurProject/augur-core/pulls/comments/125337365","pull_request_review_id":47717405,"id":125337365,"diff_hunk":"@@ -0,0 +1,90 @@\n+# Copyright (C) 2015 Forecast Foundation OU, full GPL notice in LICENSE\n+\n+#### must be first data members to match delegator.se\n+data controller\n+data controllerLookupName\n+####\n+\n+inset('../macros/externs.sem')\n+inset('../macros/safeMath.sem')\n+inset('../macros/assertNoValue.sem')\n+inset('../macros/require.sem')\n+\n+data initialized\n+data market\n+data bondHolder\n+data payoutDistributionHash #Disputed outcome\n+data bondRemainingToBePaidOut\n+data tokens[2**160]\n+data spenders[2**160][2**160]\n+data supply\n+\n+def any():\n+    assertNoValue()\n+\n+def initialize(market: address, bondHolder: address, bondAmount: int256, payoutDistributionHash: int256):\n+    require(not self.initialized)\n+    self.initialized = 1\n+    self.market = market\n+    self.bondHolder = bondHolder\n+    self.payoutDistributionHash = payoutDistributionHash\n+    self.bondRemainingToBePaidOut = bondAmount * 2\n+    self.market.getReputationToken().transferFrom(msg.sender, self, bondAmount)\n+\n+def withdraw(amountToWithdraw: int256, payoutDistributionHash: int256):\n+    require(msg.sender == self.bondHolder)\n+    require(self.market.isFinalized())\n+    require(payoutDistributionHash == self.payoutDistributionHash)\n+    if (self.bondRemainingToBePaidOut > 0):\n+        amountToTransfer = min(amountToWithdraw, self.bondRemainingToBePaidOut)\n+        self.market.getReputationToken().transfer(self.bondHolder, amountToTransfer)\n+        self.bondRemainingToBePaidOut = safeSub(self.bondRemainingToBePaidOut, amountToTransfer)\n+\n+####\n+#### Getters","path":"src/reporting/disputeBondToken.se","position":44,"original_position":44,"commit_id":"19696e8e3ec3537f1baa14f1a3a5b75b4b654991","original_commit_id":"d694eab2075b6429f8b8402854e9ca1efc7d30fd","user":{"login":"MicahZoltu","id":886059,"avatar_url":"https://avatars1.githubusercontent.com/u/886059?v=3","gravatar_id":"","url":"https://api.github.com/users/MicahZoltu","html_url":"https://github.com/MicahZoltu","followers_url":"https://api.github.com/users/MicahZoltu/followers","following_url":"https://api.github.com/users/MicahZoltu/following{/other_user}","gists_url":"https://api.github.com/users/MicahZoltu/gists{/gist_id}","starred_url":"https://api.github.com/users/MicahZoltu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MicahZoltu/subscriptions","organizations_url":"https://api.github.com/users/MicahZoltu/orgs","repos_url":"https://api.github.com/users/MicahZoltu/repos","events_url":"https://api.github.com/users/MicahZoltu/events{/privacy}","received_events_url":"https://api.github.com/users/MicahZoltu/received_events","type":"User","site_admin":false},"body":"Should have a getter for `market`, even if we don't need it in the contracts.  The UI may have the address of a bond token and need to figure out what market that bond token is for.","created_at":"2017-07-03T18:01:31Z","updated_at":"2017-07-03T18:25:31Z","html_url":"https://github.com/AugurProject/augur-core/pull/209#discussion_r125337365","pull_request_url":"https://api.github.com/repos/AugurProject/augur-core/pulls/209","_links":{"self":{"href":"https://api.github.com/repos/AugurProject/augur-core/pulls/comments/125337365"},"html":{"href":"https://github.com/AugurProject/augur-core/pull/209#discussion_r125337365"},"pull_request":{"href":"https://api.github.com/repos/AugurProject/augur-core/pulls/209"}}},"pull_request":{"url":"https://api.github.com/repos/AugurProject/augur-core/pulls/209","id":128663902,"html_url":"https://github.com/AugurProject/augur-core/pull/209","diff_url":"https://github.com/AugurProject/augur-core/pull/209.diff","patch_url":"https://github.com/AugurProject/augur-core/pull/209.patch","issue_url":"https://api.github.com/repos/AugurProject/augur-core/issues/209","number":209,"state":"open","locked":false,"title":"Bond payout fixes","user":{"login":"adrake33","id":11491365,"avatar_url":"https://avatars3.githubusercontent.com/u/11491365?v=3","gravatar_id":"","url":"https://api.github.com/users/adrake33","html_url":"https://github.com/adrake33","followers_url":"https://api.github.com/users/adrake33/followers","following_url":"https://api.github.com/users/adrake33/following{/other_user}","gists_url":"https://api.github.com/users/adrake33/gists{/gist_id}","starred_url":"https://api.github.com/users/adrake33/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adrake33/subscriptions","organizations_url":"https://api.github.com/users/adrake33/orgs","repos_url":"https://api.github.com/users/adrake33/repos","events_url":"https://api.github.com/users/adrake33/events{/privacy}","received_events_url":"https://api.github.com/users/adrake33/received_events","type":"User","site_admin":false},"body":"﻿# Pull Request Template\r\n### Overview\r\nThese changes are to ensure that bond holders get paid before transferring REP to the winning  reporting token.\r\n\r\n\r\n\r\n### Changes proposed for this pull request\r\n\r\n\r\n\r\n\r\n### Notes\r\nPlease be aware that these changes are not ready to be merged yet, as I am still writing the test cases.  However, I am creating this PR so I can get early feedback on what I've written so far. \r\n\r\n\r\n\r\n\r\n\r\n### Testing Instructions\r\nTBD\r\n\r\n\r\n\r\n\r\n\r\n### Examples (if necessary)","created_at":"2017-07-03T16:38:51Z","updated_at":"2017-07-03T18:25:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"13eb9b6744b102f63e51966f1d02ce61298ca957","assignee":null,"assignees":[],"requested_reviewers":[{"login":"joeykrug","id":5925937,"avatar_url":"https://avatars3.githubusercontent.com/u/5925937?v=3","gravatar_id":"","url":"https://api.github.com/users/joeykrug","html_url":"https://github.com/joeykrug","followers_url":"https://api.github.com/users/joeykrug/followers","following_url":"https://api.github.com/users/joeykrug/following{/other_user}","gists_url":"https://api.github.com/users/joeykrug/gists{/gist_id}","starred_url":"https://api.github.com/users/joeykrug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joeykrug/subscriptions","organizations_url":"https://api.github.com/users/joeykrug/orgs","repos_url":"https://api.github.com/users/joeykrug/repos","events_url":"https://api.github.com/users/joeykrug/events{/privacy}","received_events_url":"https://api.github.com/users/joeykrug/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/AugurProject/augur-core/pulls/209/commits","review_comments_url":"https://api.github.com/repos/AugurProject/augur-core/pulls/209/comments","review_comment_url":"https://api.github.com/repos/AugurProject/augur-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AugurProject/augur-core/issues/209/comments","statuses_url":"https://api.github.com/repos/AugurProject/augur-core/statuses/19696e8e3ec3537f1baa14f1a3a5b75b4b654991","head":{"label":"AugurProject:bond-payout","ref":"bond-payout","sha":"19696e8e3ec3537f1baa14f1a3a5b75b4b654991","user":{"login":"AugurProject","id":9636524,"avatar_url":"https://avatars0.githubusercontent.com/u/9636524?v=3","gravatar_id":"","url":"https://api.github.com/users/AugurProject","html_url":"https://github.com/AugurProject","followers_url":"https://api.github.com/users/AugurProject/followers","following_url":"https://api.github.com/users/AugurProject/following{/other_user}","gists_url":"https://api.github.com/users/AugurProject/gists{/gist_id}","starred_url":"https://api.github.com/users/AugurProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AugurProject/subscriptions","organizations_url":"https://api.github.com/users/AugurProject/orgs","repos_url":"https://api.github.com/users/AugurProject/repos","events_url":"https://api.github.com/users/AugurProject/events{/privacy}","received_events_url":"https://api.github.com/users/AugurProject/received_events","type":"Organization","site_admin":false},"repo":{"id":27623806,"name":"augur-core","full_name":"AugurProject/augur-core","owner":{"login":"AugurProject","id":9636524,"avatar_url":"https://avatars0.githubusercontent.com/u/9636524?v=3","gravatar_id":"","url":"https://api.github.com/users/AugurProject","html_url":"https://github.com/AugurProject","followers_url":"https://api.github.com/users/AugurProject/followers","following_url":"https://api.github.com/users/AugurProject/following{/other_user}","gists_url":"https://api.github.com/users/AugurProject/gists{/gist_id}","starred_url":"https://api.github.com/users/AugurProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AugurProject/subscriptions","organizations_url":"https://api.github.com/users/AugurProject/orgs","repos_url":"https://api.github.com/users/AugurProject/repos","events_url":"https://api.github.com/users/AugurProject/events{/privacy}","received_events_url":"https://api.github.com/users/AugurProject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AugurProject/augur-core","description":"Augur back-end (Ethereum contracts)","fork":false,"url":"https://api.github.com/repos/AugurProject/augur-core","forks_url":"https://api.github.com/repos/AugurProject/augur-core/forks","keys_url":"https://api.github.com/repos/AugurProject/augur-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AugurProject/augur-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AugurProject/augur-core/teams","hooks_url":"https://api.github.com/repos/AugurProject/augur-core/hooks","issue_events_url":"https://api.github.com/repos/AugurProject/augur-core/issues/events{/number}","events_url":"https://api.github.com/repos/AugurProject/augur-core/events","assignees_url":"https://api.github.com/repos/AugurProject/augur-core/assignees{/user}","branches_url":"https://api.github.com/repos/AugurProject/augur-core/branches{/branch}","tags_url":"https://api.github.com/repos/AugurProject/augur-core/tags","blobs_url":"https://api.github.com/repos/AugurProject/augur-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AugurProject/augur-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AugurProject/augur-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/AugurProject/augur-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AugurProject/augur-core/statuses/{sha}","languages_url":"https://api.github.com/repos/AugurProject/augur-core/languages","stargazers_url":"https://api.github.com/repos/AugurProject/augur-core/stargazers","contributors_url":"https://api.github.com/repos/AugurProject/augur-core/contributors","subscribers_url":"https://api.github.com/repos/AugurProject/augur-core/subscribers","subscription_url":"https://api.github.com/repos/AugurProject/augur-core/subscription","commits_url":"https://api.github.com/repos/AugurProject/augur-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/AugurProject/augur-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/AugurProject/augur-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/AugurProject/augur-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/AugurProject/augur-core/contents/{+path}","compare_url":"https://api.github.com/repos/AugurProject/augur-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AugurProject/augur-core/merges","archive_url":"https://api.github.com/repos/AugurProject/augur-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AugurProject/augur-core/downloads","issues_url":"https://api.github.com/repos/AugurProject/augur-core/issues{/number}","pulls_url":"https://api.github.com/repos/AugurProject/augur-core/pulls{/number}","milestones_url":"https://api.github.com/repos/AugurProject/augur-core/milestones{/number}","notifications_url":"https://api.github.com/repos/AugurProject/augur-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AugurProject/augur-core/labels{/name}","releases_url":"https://api.github.com/repos/AugurProject/augur-core/releases{/id}","deployments_url":"https://api.github.com/repos/AugurProject/augur-core/deployments","created_at":"2014-12-06T05:42:19Z","updated_at":"2017-07-03T10:01:54Z","pushed_at":"2017-07-03T18:25:25Z","git_url":"git://github.com/AugurProject/augur-core.git","ssh_url":"git@github.com:AugurProject/augur-core.git","clone_url":"https://github.com/AugurProject/augur-core.git","svn_url":"https://github.com/AugurProject/augur-core","homepage":"https://www.augur.net","size":11241,"stargazers_count":192,"watchers_count":192,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":50,"mirror_url":null,"open_issues_count":12,"forks":50,"open_issues":12,"watchers":192,"default_branch":"develop"}},"base":{"label":"AugurProject:reporting-refactor-take-2","ref":"reporting-refactor-take-2","sha":"17afe94816e0bfd8e9f97ec80fe6d6127b97b607","user":{"login":"AugurProject","id":9636524,"avatar_url":"https://avatars0.githubusercontent.com/u/9636524?v=3","gravatar_id":"","url":"https://api.github.com/users/AugurProject","html_url":"https://github.com/AugurProject","followers_url":"https://api.github.com/users/AugurProject/followers","following_url":"https://api.github.com/users/AugurProject/following{/other_user}","gists_url":"https://api.github.com/users/AugurProject/gists{/gist_id}","starred_url":"https://api.github.com/users/AugurProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AugurProject/subscriptions","organizations_url":"https://api.github.com/users/AugurProject/orgs","repos_url":"https://api.github.com/users/AugurProject/repos","events_url":"https://api.github.com/users/AugurProject/events{/privacy}","received_events_url":"https://api.github.com/users/AugurProject/received_events","type":"Organization","site_admin":false},"repo":{"id":27623806,"name":"augur-core","full_name":"AugurProject/augur-core","owner":{"login":"AugurProject","id":9636524,"avatar_url":"https://avatars0.githubusercontent.com/u/9636524?v=3","gravatar_id":"","url":"https://api.github.com/users/AugurProject","html_url":"https://github.com/AugurProject","followers_url":"https://api.github.com/users/AugurProject/followers","following_url":"https://api.github.com/users/AugurProject/following{/other_user}","gists_url":"https://api.github.com/users/AugurProject/gists{/gist_id}","starred_url":"https://api.github.com/users/AugurProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AugurProject/subscriptions","organizations_url":"https://api.github.com/users/AugurProject/orgs","repos_url":"https://api.github.com/users/AugurProject/repos","events_url":"https://api.github.com/users/AugurProject/events{/privacy}","received_events_url":"https://api.github.com/users/AugurProject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AugurProject/augur-core","description":"Augur back-end (Ethereum contracts)","fork":false,"url":"https://api.github.com/repos/AugurProject/augur-core","forks_url":"https://api.github.com/repos/AugurProject/augur-core/forks","keys_url":"https://api.github.com/repos/AugurProject/augur-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AugurProject/augur-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AugurProject/augur-core/teams","hooks_url":"https://api.github.com/repos/AugurProject/augur-core/hooks","issue_events_url":"https://api.github.com/repos/AugurProject/augur-core/issues/events{/number}","events_url":"https://api.github.com/repos/AugurProject/augur-core/events","assignees_url":"https://api.github.com/repos/AugurProject/augur-core/assignees{/user}","branches_url":"https://api.github.com/repos/AugurProject/augur-core/branches{/branch}","tags_url":"https://api.github.com/repos/AugurProject/augur-core/tags","blobs_url":"https://api.github.com/repos/AugurProject/augur-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AugurProject/augur-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AugurProject/augur-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/AugurProject/augur-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AugurProject/augur-core/statuses/{sha}","languages_url":"https://api.github.com/repos/AugurProject/augur-core/languages","stargazers_url":"https://api.github.com/repos/AugurProject/augur-core/stargazers","contributors_url":"https://api.github.com/repos/AugurProject/augur-core/contributors","subscribers_url":"https://api.github.com/repos/AugurProject/augur-core/subscribers","subscription_url":"https://api.github.com/repos/AugurProject/augur-core/subscription","commits_url":"https://api.github.com/repos/AugurProject/augur-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/AugurProject/augur-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/AugurProject/augur-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/AugurProject/augur-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/AugurProject/augur-core/contents/{+path}","compare_url":"https://api.github.com/repos/AugurProject/augur-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AugurProject/augur-core/merges","archive_url":"https://api.github.com/repos/AugurProject/augur-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AugurProject/augur-core/downloads","issues_url":"https://api.github.com/repos/AugurProject/augur-core/issues{/number}","pulls_url":"https://api.github.com/repos/AugurProject/augur-core/pulls{/number}","milestones_url":"https://api.github.com/repos/AugurProject/augur-core/milestones{/number}","notifications_url":"https://api.github.com/repos/AugurProject/augur-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AugurProject/augur-core/labels{/name}","releases_url":"https://api.github.com/repos/AugurProject/augur-core/releases{/id}","deployments_url":"https://api.github.com/repos/AugurProject/augur-core/deployments","created_at":"2014-12-06T05:42:19Z","updated_at":"2017-07-03T10:01:54Z","pushed_at":"2017-07-03T18:25:25Z","git_url":"git://github.com/AugurProject/augur-core.git","ssh_url":"git@github.com:AugurProject/augur-core.git","clone_url":"https://github.com/AugurProject/augur-core.git","svn_url":"https://github.com/AugurProject/augur-core","homepage":"https://www.augur.net","size":11241,"stargazers_count":192,"watchers_count":192,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":50,"mirror_url":null,"open_issues_count":12,"forks":50,"open_issues":12,"watchers":192,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/AugurProject/augur-core/pulls/209"},"html":{"href":"https://github.com/AugurProject/augur-core/pull/209"},"issue":{"href":"https://api.github.com/repos/AugurProject/augur-core/issues/209"},"comments":{"href":"https://api.github.com/repos/AugurProject/augur-core/issues/209/comments"},"review_comments":{"href":"https://api.github.com/repos/AugurProject/augur-core/pulls/209/comments"},"review_comment":{"href":"https://api.github.com/repos/AugurProject/augur-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AugurProject/augur-core/pulls/209/commits"},"statuses":{"href":"https://api.github.com/repos/AugurProject/augur-core/statuses/19696e8e3ec3537f1baa14f1a3a5b75b4b654991"}}}}
{"actor":{"display_login":"MicahZoltu"}}