{"action":"created","comment":{"url":"https://api.github.com/repos/dharmaprotocol/charta/pulls/comments/174987436","pull_request_review_id":104443308,"id":174987436,"diff_hunk":"@@ -0,0 +1,148 @@\n+import { SeizeCollateralScenario, TestContracts } from \"../runners/\";\n+\n+// external\n+import { BigNumber } from \"bignumber.js\";\n+import * as moment from \"moment\";\n+\n+// utils\n+import * as Units from \"../../../test_utils/units\";\n+\n+const defaultArgs = {\n+    collateralAmount: Units.ether(1),\n+    gracePeriodInDays: new BigNumber(7),\n+    valueRepaidToDate: Units.ether(0),\n+    expectedRepaymentValueSchedule: [\n+        {\n+            timestamp: moment()\n+                .subtract(8, \"days\")\n+                .unix(),\n+            expectedRepaymentValue: Units.ether(0.5),\n+        },\n+    ],\n+    termsContract: (collateralizedContract: string, attacker: string) => collateralizedContract,\n+    beneficiary: (originalBeneficiary: string, other: string) => originalBeneficiary,\n+    from: (beneficiary: string, other: string) => beneficiary,\n+    debtAgreementExists: true,\n+    debtAgreementCollateralized: true,\n+    succeeds: true,\n+};\n+\n+export const SUCCESSFUL_SEIZURE: SeizeCollateralScenario[] = [","path":"test/ts/unit/collateralized/scenarios/successful_seizure.ts","position":30,"original_position":30,"commit_id":"f45b0c07125b7ecd0570eef7720f47b85cf44a46","original_commit_id":"f45b0c07125b7ecd0570eef7720f47b85cf44a46","user":{"login":"saturnial","id":683181,"avatar_url":"https://avatars2.githubusercontent.com/u/683181?v=4","gravatar_id":"","url":"https://api.github.com/users/saturnial","html_url":"https://github.com/saturnial","followers_url":"https://api.github.com/users/saturnial/followers","following_url":"https://api.github.com/users/saturnial/following{/other_user}","gists_url":"https://api.github.com/users/saturnial/gists{/gist_id}","starred_url":"https://api.github.com/users/saturnial/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saturnial/subscriptions","organizations_url":"https://api.github.com/users/saturnial/orgs","repos_url":"https://api.github.com/users/saturnial/repos","events_url":"https://api.github.com/users/saturnial/events{/privacy}","received_events_url":"https://api.github.com/users/saturnial/received_events","type":"User","site_admin":false},"body":"`SUCCESSFUL_SEIZURE_SCENARIOS`","created_at":"2018-03-16T03:00:34Z","updated_at":"2018-03-16T03:00:34Z","html_url":"https://github.com/dharmaprotocol/charta/pull/45#discussion_r174987436","pull_request_url":"https://api.github.com/repos/dharmaprotocol/charta/pulls/45","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/dharmaprotocol/charta/pulls/comments/174987436"},"html":{"href":"https://github.com/dharmaprotocol/charta/pull/45#discussion_r174987436"},"pull_request":{"href":"https://api.github.com/repos/dharmaprotocol/charta/pulls/45"}}},"pull_request":{"url":"https://api.github.com/repos/dharmaprotocol/charta/pulls/45","id":175310384,"html_url":"https://github.com/dharmaprotocol/charta/pull/45","diff_url":"https://github.com/dharmaprotocol/charta/pull/45.diff","patch_url":"https://github.com/dharmaprotocol/charta/pull/45.patch","issue_url":"https://api.github.com/repos/dharmaprotocol/charta/issues/45","number":45,"state":"open","locked":false,"title":"Add Collateralized variant that pulls on term start","user":{"login":"nadavhollander","id":3241822,"avatar_url":"https://avatars1.githubusercontent.com/u/3241822?v=4","gravatar_id":"","url":"https://api.github.com/users/nadavhollander","html_url":"https://github.com/nadavhollander","followers_url":"https://api.github.com/users/nadavhollander/followers","following_url":"https://api.github.com/users/nadavhollander/following{/other_user}","gists_url":"https://api.github.com/users/nadavhollander/gists{/gist_id}","starred_url":"https://api.github.com/users/nadavhollander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nadavhollander/subscriptions","organizations_url":"https://api.github.com/users/nadavhollander/orgs","repos_url":"https://api.github.com/users/nadavhollander/repos","events_url":"https://api.github.com/users/nadavhollander/events{/privacy}","received_events_url":"https://api.github.com/users/nadavhollander/received_events","type":"User","site_admin":false},"body":"This PR introduces the following changes:\r\n\r\n- Modifies DebtKernel to only `registerTermStart` if there is a terms contract associated with the agreement\r\n- Builds on @saturnial and @jdkanani 's work by overhauling the mechanism by which the `Collateralized.sol` file works, such that collateral is only pulled from the borrower once the debt agreement is filled by a creditor.  This should dramatically improve the UX of locking up collateral by requiring less upfront transactions.\r\n- Introduces unit test suite following the scenario runner pattern we leverage in `dharma.js`\r\n\r\nThis begins to address https://www.pivotaltracker.com/story/show/155666291\r\n\r\n**This is fairly mission critical code -- please audit carefully for vulnerabilities**\r\n\r\nApologies to the reviewers for the massive PR size -- if you'd like, I can split it into several smaller PRs (though I'm not sure what tangible difference that would make in the amount of time it takes you to review it)","created_at":"2018-03-15T16:39:07Z","updated_at":"2018-03-16T03:00:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/dharmaprotocol/charta/pulls/45/commits","review_comments_url":"https://api.github.com/repos/dharmaprotocol/charta/pulls/45/comments","review_comment_url":"https://api.github.com/repos/dharmaprotocol/charta/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dharmaprotocol/charta/issues/45/comments","statuses_url":"https://api.github.com/repos/dharmaprotocol/charta/statuses/f45b0c07125b7ecd0570eef7720f47b85cf44a46","head":{"label":"dharmaprotocol:nadav-collateral-pull","ref":"nadav-collateral-pull","sha":"f45b0c07125b7ecd0570eef7720f47b85cf44a46","user":{"login":"dharmaprotocol","id":28667653,"avatar_url":"https://avatars3.githubusercontent.com/u/28667653?v=4","gravatar_id":"","url":"https://api.github.com/users/dharmaprotocol","html_url":"https://github.com/dharmaprotocol","followers_url":"https://api.github.com/users/dharmaprotocol/followers","following_url":"https://api.github.com/users/dharmaprotocol/following{/other_user}","gists_url":"https://api.github.com/users/dharmaprotocol/gists{/gist_id}","starred_url":"https://api.github.com/users/dharmaprotocol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dharmaprotocol/subscriptions","organizations_url":"https://api.github.com/users/dharmaprotocol/orgs","repos_url":"https://api.github.com/users/dharmaprotocol/repos","events_url":"https://api.github.com/users/dharmaprotocol/events{/privacy}","received_events_url":"https://api.github.com/users/dharmaprotocol/received_events","type":"Organization","site_admin":false},"repo":{"id":111745346,"name":"charta","full_name":"dharmaprotocol/charta","owner":{"login":"dharmaprotocol","id":28667653,"avatar_url":"https://avatars3.githubusercontent.com/u/28667653?v=4","gravatar_id":"","url":"https://api.github.com/users/dharmaprotocol","html_url":"https://github.com/dharmaprotocol","followers_url":"https://api.github.com/users/dharmaprotocol/followers","following_url":"https://api.github.com/users/dharmaprotocol/following{/other_user}","gists_url":"https://api.github.com/users/dharmaprotocol/gists{/gist_id}","starred_url":"https://api.github.com/users/dharmaprotocol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dharmaprotocol/subscriptions","organizations_url":"https://api.github.com/users/dharmaprotocol/orgs","repos_url":"https://api.github.com/users/dharmaprotocol/repos","events_url":"https://api.github.com/users/dharmaprotocol/events{/privacy}","received_events_url":"https://api.github.com/users/dharmaprotocol/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dharmaprotocol/charta","description":"New & improved contracts for Dharma protocol as specified in https://whitepaper.dharma.io","fork":false,"url":"https://api.github.com/repos/dharmaprotocol/charta","forks_url":"https://api.github.com/repos/dharmaprotocol/charta/forks","keys_url":"https://api.github.com/repos/dharmaprotocol/charta/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dharmaprotocol/charta/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dharmaprotocol/charta/teams","hooks_url":"https://api.github.com/repos/dharmaprotocol/charta/hooks","issue_events_url":"https://api.github.com/repos/dharmaprotocol/charta/issues/events{/number}","events_url":"https://api.github.com/repos/dharmaprotocol/charta/events","assignees_url":"https://api.github.com/repos/dharmaprotocol/charta/assignees{/user}","branches_url":"https://api.github.com/repos/dharmaprotocol/charta/branches{/branch}","tags_url":"https://api.github.com/repos/dharmaprotocol/charta/tags","blobs_url":"https://api.github.com/repos/dharmaprotocol/charta/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dharmaprotocol/charta/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dharmaprotocol/charta/git/refs{/sha}","trees_url":"https://api.github.com/repos/dharmaprotocol/charta/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dharmaprotocol/charta/statuses/{sha}","languages_url":"https://api.github.com/repos/dharmaprotocol/charta/languages","stargazers_url":"https://api.github.com/repos/dharmaprotocol/charta/stargazers","contributors_url":"https://api.github.com/repos/dharmaprotocol/charta/contributors","subscribers_url":"https://api.github.com/repos/dharmaprotocol/charta/subscribers","subscription_url":"https://api.github.com/repos/dharmaprotocol/charta/subscription","commits_url":"https://api.github.com/repos/dharmaprotocol/charta/commits{/sha}","git_commits_url":"https://api.github.com/repos/dharmaprotocol/charta/git/commits{/sha}","comments_url":"https://api.github.com/repos/dharmaprotocol/charta/comments{/number}","issue_comment_url":"https://api.github.com/repos/dharmaprotocol/charta/issues/comments{/number}","contents_url":"https://api.github.com/repos/dharmaprotocol/charta/contents/{+path}","compare_url":"https://api.github.com/repos/dharmaprotocol/charta/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dharmaprotocol/charta/merges","archive_url":"https://api.github.com/repos/dharmaprotocol/charta/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dharmaprotocol/charta/downloads","issues_url":"https://api.github.com/repos/dharmaprotocol/charta/issues{/number}","pulls_url":"https://api.github.com/repos/dharmaprotocol/charta/pulls{/number}","milestones_url":"https://api.github.com/repos/dharmaprotocol/charta/milestones{/number}","notifications_url":"https://api.github.com/repos/dharmaprotocol/charta/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dharmaprotocol/charta/labels{/name}","releases_url":"https://api.github.com/repos/dharmaprotocol/charta/releases{/id}","deployments_url":"https://api.github.com/repos/dharmaprotocol/charta/deployments","created_at":"2017-11-23T00:25:44Z","updated_at":"2018-02-26T01:17:45Z","pushed_at":"2018-03-15T20:12:21Z","git_url":"git://github.com/dharmaprotocol/charta.git","ssh_url":"git@github.com:dharmaprotocol/charta.git","clone_url":"https://github.com/dharmaprotocol/charta.git","svn_url":"https://github.com/dharmaprotocol/charta","homepage":null,"size":26021,"stargazers_count":25,"watchers_count":25,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":3,"license":null,"forks":7,"open_issues":3,"watchers":25,"default_branch":"master"}},"base":{"label":"dharmaprotocol:nadav-modify-register-term-start-sig","ref":"nadav-modify-register-term-start-sig","sha":"d056c1e637d46a3908b6700d468059f3ceb489ee","user":{"login":"dharmaprotocol","id":28667653,"avatar_url":"https://avatars3.githubusercontent.com/u/28667653?v=4","gravatar_id":"","url":"https://api.github.com/users/dharmaprotocol","html_url":"https://github.com/dharmaprotocol","followers_url":"https://api.github.com/users/dharmaprotocol/followers","following_url":"https://api.github.com/users/dharmaprotocol/following{/other_user}","gists_url":"https://api.github.com/users/dharmaprotocol/gists{/gist_id}","starred_url":"https://api.github.com/users/dharmaprotocol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dharmaprotocol/subscriptions","organizations_url":"https://api.github.com/users/dharmaprotocol/orgs","repos_url":"https://api.github.com/users/dharmaprotocol/repos","events_url":"https://api.github.com/users/dharmaprotocol/events{/privacy}","received_events_url":"https://api.github.com/users/dharmaprotocol/received_events","type":"Organization","site_admin":false},"repo":{"id":111745346,"name":"charta","full_name":"dharmaprotocol/charta","owner":{"login":"dharmaprotocol","id":28667653,"avatar_url":"https://avatars3.githubusercontent.com/u/28667653?v=4","gravatar_id":"","url":"https://api.github.com/users/dharmaprotocol","html_url":"https://github.com/dharmaprotocol","followers_url":"https://api.github.com/users/dharmaprotocol/followers","following_url":"https://api.github.com/users/dharmaprotocol/following{/other_user}","gists_url":"https://api.github.com/users/dharmaprotocol/gists{/gist_id}","starred_url":"https://api.github.com/users/dharmaprotocol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dharmaprotocol/subscriptions","organizations_url":"https://api.github.com/users/dharmaprotocol/orgs","repos_url":"https://api.github.com/users/dharmaprotocol/repos","events_url":"https://api.github.com/users/dharmaprotocol/events{/privacy}","received_events_url":"https://api.github.com/users/dharmaprotocol/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dharmaprotocol/charta","description":"New & improved contracts for Dharma protocol as specified in https://whitepaper.dharma.io","fork":false,"url":"https://api.github.com/repos/dharmaprotocol/charta","forks_url":"https://api.github.com/repos/dharmaprotocol/charta/forks","keys_url":"https://api.github.com/repos/dharmaprotocol/charta/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dharmaprotocol/charta/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dharmaprotocol/charta/teams","hooks_url":"https://api.github.com/repos/dharmaprotocol/charta/hooks","issue_events_url":"https://api.github.com/repos/dharmaprotocol/charta/issues/events{/number}","events_url":"https://api.github.com/repos/dharmaprotocol/charta/events","assignees_url":"https://api.github.com/repos/dharmaprotocol/charta/assignees{/user}","branches_url":"https://api.github.com/repos/dharmaprotocol/charta/branches{/branch}","tags_url":"https://api.github.com/repos/dharmaprotocol/charta/tags","blobs_url":"https://api.github.com/repos/dharmaprotocol/charta/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dharmaprotocol/charta/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dharmaprotocol/charta/git/refs{/sha}","trees_url":"https://api.github.com/repos/dharmaprotocol/charta/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dharmaprotocol/charta/statuses/{sha}","languages_url":"https://api.github.com/repos/dharmaprotocol/charta/languages","stargazers_url":"https://api.github.com/repos/dharmaprotocol/charta/stargazers","contributors_url":"https://api.github.com/repos/dharmaprotocol/charta/contributors","subscribers_url":"https://api.github.com/repos/dharmaprotocol/charta/subscribers","subscription_url":"https://api.github.com/repos/dharmaprotocol/charta/subscription","commits_url":"https://api.github.com/repos/dharmaprotocol/charta/commits{/sha}","git_commits_url":"https://api.github.com/repos/dharmaprotocol/charta/git/commits{/sha}","comments_url":"https://api.github.com/repos/dharmaprotocol/charta/comments{/number}","issue_comment_url":"https://api.github.com/repos/dharmaprotocol/charta/issues/comments{/number}","contents_url":"https://api.github.com/repos/dharmaprotocol/charta/contents/{+path}","compare_url":"https://api.github.com/repos/dharmaprotocol/charta/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dharmaprotocol/charta/merges","archive_url":"https://api.github.com/repos/dharmaprotocol/charta/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dharmaprotocol/charta/downloads","issues_url":"https://api.github.com/repos/dharmaprotocol/charta/issues{/number}","pulls_url":"https://api.github.com/repos/dharmaprotocol/charta/pulls{/number}","milestones_url":"https://api.github.com/repos/dharmaprotocol/charta/milestones{/number}","notifications_url":"https://api.github.com/repos/dharmaprotocol/charta/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dharmaprotocol/charta/labels{/name}","releases_url":"https://api.github.com/repos/dharmaprotocol/charta/releases{/id}","deployments_url":"https://api.github.com/repos/dharmaprotocol/charta/deployments","created_at":"2017-11-23T00:25:44Z","updated_at":"2018-02-26T01:17:45Z","pushed_at":"2018-03-15T20:12:21Z","git_url":"git://github.com/dharmaprotocol/charta.git","ssh_url":"git@github.com:dharmaprotocol/charta.git","clone_url":"https://github.com/dharmaprotocol/charta.git","svn_url":"https://github.com/dharmaprotocol/charta","homepage":null,"size":26021,"stargazers_count":25,"watchers_count":25,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":3,"license":null,"forks":7,"open_issues":3,"watchers":25,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dharmaprotocol/charta/pulls/45"},"html":{"href":"https://github.com/dharmaprotocol/charta/pull/45"},"issue":{"href":"https://api.github.com/repos/dharmaprotocol/charta/issues/45"},"comments":{"href":"https://api.github.com/repos/dharmaprotocol/charta/issues/45/comments"},"review_comments":{"href":"https://api.github.com/repos/dharmaprotocol/charta/pulls/45/comments"},"review_comment":{"href":"https://api.github.com/repos/dharmaprotocol/charta/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dharmaprotocol/charta/pulls/45/commits"},"statuses":{"href":"https://api.github.com/repos/dharmaprotocol/charta/statuses/f45b0c07125b7ecd0570eef7720f47b85cf44a46"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"saturnial"}}