{"action":"created","comment":{"url":"https://api.github.com/repos/piction-network/smart-ico/pulls/comments/196684580","pull_request_review_id":130282372,"id":196684580,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NjY4NDU4MA==","diff_hunk":"@@ -127,51 +139,69 @@ contract Sale is Stateable {\n             buyer.transfer(refund);\n         }\n \n-        if(totalAmount >= product.maxcap()) {\n+        weiRaised[productAddress] = weiRaised[productAddress].add(purchase);\n+\n+        if(weiRaised[productAddress] >= product.maxcap()) {\n             setState(State.Finished);\n         }\n \n         emit Purchase(buyer, purchase, refund, purchase.mul(product.rate()));\n     }\n \n-    function getPurchaseDetail(uint256 _buyerAmount, uint256 _amount) private view returns (uint256, uint256, uint256) {\n-        uint256 d1 = product.maxcap().sub(product.weiRaised());\n+    function getPurchaseDetail(uint256 _buyerAmount, uint256 _amount, address _product)\n+        private\n+        view\n+        returns (uint256, uint256)\n+    {\n+        uint256 d1 = product.maxcap().sub(weiRaised[_product]);\n         uint256 d2 = product.exceed().sub(_buyerAmount);\n         uint256 possibleAmount = (d1.min256(d2)).min256(_amount);\n \n-        return (possibleAmount, _amount.sub(possibleAmount), possibleAmount.add(product.weiRaised()));\n+        return (possibleAmount, _amount.sub(possibleAmount));\n     }\n \n-    function refund(string _productName, address _buyerAddress) external onlyOwner validProductName(_productName) validAddress(_buyerAddress) {\n-        require(buyers[_productName][_buyerAddress] > 0);\n+    function refund(address _product, address _buyer)\n+        external\n+        onlyOwner\n+        validAddress(_product)\n+        validAddress(_buyer)\n+        validProductAddress(_product)","path":"contracts/sale/Sale.sol","position":149,"original_position":149,"commit_id":"5024e1c2c8aca2ff9706071fd937ebbe53d023ac","original_commit_id":"d29ced6f33b375b72508aee0144fa453c800d428","user":{"login":"charlskim","id":30612572,"node_id":"MDQ6VXNlcjMwNjEyNTcy","avatar_url":"https://avatars2.githubusercontent.com/u/30612572?v=4","gravatar_id":"","url":"https://api.github.com/users/charlskim","html_url":"https://github.com/charlskim","followers_url":"https://api.github.com/users/charlskim/followers","following_url":"https://api.github.com/users/charlskim/following{/other_user}","gists_url":"https://api.github.com/users/charlskim/gists{/gist_id}","starred_url":"https://api.github.com/users/charlskim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charlskim/subscriptions","organizations_url":"https://api.github.com/users/charlskim/orgs","repos_url":"https://api.github.com/users/charlskim/repos","events_url":"https://api.github.com/users/charlskim/events{/privacy}","received_events_url":"https://api.github.com/users/charlskim/received_events","type":"User","site_admin":false},"body":"확인해보니 맞는 말씀입니다.\r\n수정하겠습니다.\r\n감사합니다. 👍 ","created_at":"2018-06-20T08:14:32Z","updated_at":"2018-06-20T08:14:32Z","html_url":"https://github.com/piction-network/smart-ico/pull/18#discussion_r196684580","pull_request_url":"https://api.github.com/repos/piction-network/smart-ico/pulls/18","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/piction-network/smart-ico/pulls/comments/196684580"},"html":{"href":"https://github.com/piction-network/smart-ico/pull/18#discussion_r196684580"},"pull_request":{"href":"https://api.github.com/repos/piction-network/smart-ico/pulls/18"}},"in_reply_to_id":196684274},"pull_request":{"url":"https://api.github.com/repos/piction-network/smart-ico/pulls/18","id":196052129,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2MDUyMTI5","html_url":"https://github.com/piction-network/smart-ico/pull/18","diff_url":"https://github.com/piction-network/smart-ico/pull/18.diff","patch_url":"https://github.com/piction-network/smart-ico/pull/18.patch","issue_url":"https://api.github.com/repos/piction-network/smart-ico/issues/18","number":18,"state":"open","locked":false,"title":"Sale contract 스펙 변경, 코드 수정","user":{"login":"charlskim","id":30612572,"node_id":"MDQ6VXNlcjMwNjEyNTcy","avatar_url":"https://avatars2.githubusercontent.com/u/30612572?v=4","gravatar_id":"","url":"https://api.github.com/users/charlskim","html_url":"https://github.com/charlskim","followers_url":"https://api.github.com/users/charlskim/followers","following_url":"https://api.github.com/users/charlskim/following{/other_user}","gists_url":"https://api.github.com/users/charlskim/gists{/gist_id}","starred_url":"https://api.github.com/users/charlskim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charlskim/subscriptions","organizations_url":"https://api.github.com/users/charlskim/orgs","repos_url":"https://api.github.com/users/charlskim/repos","events_url":"https://api.github.com/users/charlskim/events{/privacy}","received_events_url":"https://api.github.com/users/charlskim/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-06-20T08:00:37Z","updated_at":"2018-06-20T08:14:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e763a903146ea2dab2c47187746fbbbfeffe7b2c","assignee":null,"assignees":[],"requested_reviewers":[{"login":"jhseo","id":4862222,"node_id":"MDQ6VXNlcjQ4NjIyMjI=","avatar_url":"https://avatars0.githubusercontent.com/u/4862222?v=4","gravatar_id":"","url":"https://api.github.com/users/jhseo","html_url":"https://github.com/jhseo","followers_url":"https://api.github.com/users/jhseo/followers","following_url":"https://api.github.com/users/jhseo/following{/other_user}","gists_url":"https://api.github.com/users/jhseo/gists{/gist_id}","starred_url":"https://api.github.com/users/jhseo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhseo/subscriptions","organizations_url":"https://api.github.com/users/jhseo/orgs","repos_url":"https://api.github.com/users/jhseo/repos","events_url":"https://api.github.com/users/jhseo/events{/privacy}","received_events_url":"https://api.github.com/users/jhseo/received_events","type":"User","site_admin":false},{"login":"skkwon80","id":13342921,"node_id":"MDQ6VXNlcjEzMzQyOTIx","avatar_url":"https://avatars0.githubusercontent.com/u/13342921?v=4","gravatar_id":"","url":"https://api.github.com/users/skkwon80","html_url":"https://github.com/skkwon80","followers_url":"https://api.github.com/users/skkwon80/followers","following_url":"https://api.github.com/users/skkwon80/following{/other_user}","gists_url":"https://api.github.com/users/skkwon80/gists{/gist_id}","starred_url":"https://api.github.com/users/skkwon80/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skkwon80/subscriptions","organizations_url":"https://api.github.com/users/skkwon80/orgs","repos_url":"https://api.github.com/users/skkwon80/repos","events_url":"https://api.github.com/users/skkwon80/events{/privacy}","received_events_url":"https://api.github.com/users/skkwon80/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/piction-network/smart-ico/pulls/18/commits","review_comments_url":"https://api.github.com/repos/piction-network/smart-ico/pulls/18/comments","review_comment_url":"https://api.github.com/repos/piction-network/smart-ico/pulls/comments{/number}","comments_url":"https://api.github.com/repos/piction-network/smart-ico/issues/18/comments","statuses_url":"https://api.github.com/repos/piction-network/smart-ico/statuses/5024e1c2c8aca2ff9706071fd937ebbe53d023ac","head":{"label":"piction-network:feature/sale","ref":"feature/sale","sha":"5024e1c2c8aca2ff9706071fd937ebbe53d023ac","user":{"login":"piction-network","id":38724316,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4NzI0MzE2","avatar_url":"https://avatars0.githubusercontent.com/u/38724316?v=4","gravatar_id":"","url":"https://api.github.com/users/piction-network","html_url":"https://github.com/piction-network","followers_url":"https://api.github.com/users/piction-network/followers","following_url":"https://api.github.com/users/piction-network/following{/other_user}","gists_url":"https://api.github.com/users/piction-network/gists{/gist_id}","starred_url":"https://api.github.com/users/piction-network/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piction-network/subscriptions","organizations_url":"https://api.github.com/users/piction-network/orgs","repos_url":"https://api.github.com/users/piction-network/repos","events_url":"https://api.github.com/users/piction-network/events{/privacy}","received_events_url":"https://api.github.com/users/piction-network/received_events","type":"Organization","site_admin":false},"repo":{"id":137008115,"node_id":"MDEwOlJlcG9zaXRvcnkxMzcwMDgxMTU=","name":"smart-ico","full_name":"piction-network/smart-ico","owner":{"login":"piction-network","id":38724316,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4NzI0MzE2","avatar_url":"https://avatars0.githubusercontent.com/u/38724316?v=4","gravatar_id":"","url":"https://api.github.com/users/piction-network","html_url":"https://github.com/piction-network","followers_url":"https://api.github.com/users/piction-network/followers","following_url":"https://api.github.com/users/piction-network/following{/other_user}","gists_url":"https://api.github.com/users/piction-network/gists{/gist_id}","starred_url":"https://api.github.com/users/piction-network/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piction-network/subscriptions","organizations_url":"https://api.github.com/users/piction-network/orgs","repos_url":"https://api.github.com/users/piction-network/repos","events_url":"https://api.github.com/users/piction-network/events{/privacy}","received_events_url":"https://api.github.com/users/piction-network/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/piction-network/smart-ico","description":"smart-ico","fork":false,"url":"https://api.github.com/repos/piction-network/smart-ico","forks_url":"https://api.github.com/repos/piction-network/smart-ico/forks","keys_url":"https://api.github.com/repos/piction-network/smart-ico/keys{/key_id}","collaborators_url":"https://api.github.com/repos/piction-network/smart-ico/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/piction-network/smart-ico/teams","hooks_url":"https://api.github.com/repos/piction-network/smart-ico/hooks","issue_events_url":"https://api.github.com/repos/piction-network/smart-ico/issues/events{/number}","events_url":"https://api.github.com/repos/piction-network/smart-ico/events","assignees_url":"https://api.github.com/repos/piction-network/smart-ico/assignees{/user}","branches_url":"https://api.github.com/repos/piction-network/smart-ico/branches{/branch}","tags_url":"https://api.github.com/repos/piction-network/smart-ico/tags","blobs_url":"https://api.github.com/repos/piction-network/smart-ico/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/piction-network/smart-ico/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/piction-network/smart-ico/git/refs{/sha}","trees_url":"https://api.github.com/repos/piction-network/smart-ico/git/trees{/sha}","statuses_url":"https://api.github.com/repos/piction-network/smart-ico/statuses/{sha}","languages_url":"https://api.github.com/repos/piction-network/smart-ico/languages","stargazers_url":"https://api.github.com/repos/piction-network/smart-ico/stargazers","contributors_url":"https://api.github.com/repos/piction-network/smart-ico/contributors","subscribers_url":"https://api.github.com/repos/piction-network/smart-ico/subscribers","subscription_url":"https://api.github.com/repos/piction-network/smart-ico/subscription","commits_url":"https://api.github.com/repos/piction-network/smart-ico/commits{/sha}","git_commits_url":"https://api.github.com/repos/piction-network/smart-ico/git/commits{/sha}","comments_url":"https://api.github.com/repos/piction-network/smart-ico/comments{/number}","issue_comment_url":"https://api.github.com/repos/piction-network/smart-ico/issues/comments{/number}","contents_url":"https://api.github.com/repos/piction-network/smart-ico/contents/{+path}","compare_url":"https://api.github.com/repos/piction-network/smart-ico/compare/{base}...{head}","merges_url":"https://api.github.com/repos/piction-network/smart-ico/merges","archive_url":"https://api.github.com/repos/piction-network/smart-ico/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/piction-network/smart-ico/downloads","issues_url":"https://api.github.com/repos/piction-network/smart-ico/issues{/number}","pulls_url":"https://api.github.com/repos/piction-network/smart-ico/pulls{/number}","milestones_url":"https://api.github.com/repos/piction-network/smart-ico/milestones{/number}","notifications_url":"https://api.github.com/repos/piction-network/smart-ico/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/piction-network/smart-ico/labels{/name}","releases_url":"https://api.github.com/repos/piction-network/smart-ico/releases{/id}","deployments_url":"https://api.github.com/repos/piction-network/smart-ico/deployments","created_at":"2018-06-12T02:47:09Z","updated_at":"2018-06-20T06:46:14Z","pushed_at":"2018-06-20T08:03:57Z","git_url":"git://github.com/piction-network/smart-ico.git","ssh_url":"git@github.com:piction-network/smart-ico.git","clone_url":"https://github.com/piction-network/smart-ico.git","svn_url":"https://github.com/piction-network/smart-ico","homepage":null,"size":123,"stargazers_count":0,"watchers_count":0,"language":"Solidity","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"piction-network:master","ref":"master","sha":"d0a754f8ba865a0df29c482422926e085d36c991","user":{"login":"piction-network","id":38724316,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4NzI0MzE2","avatar_url":"https://avatars0.githubusercontent.com/u/38724316?v=4","gravatar_id":"","url":"https://api.github.com/users/piction-network","html_url":"https://github.com/piction-network","followers_url":"https://api.github.com/users/piction-network/followers","following_url":"https://api.github.com/users/piction-network/following{/other_user}","gists_url":"https://api.github.com/users/piction-network/gists{/gist_id}","starred_url":"https://api.github.com/users/piction-network/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piction-network/subscriptions","organizations_url":"https://api.github.com/users/piction-network/orgs","repos_url":"https://api.github.com/users/piction-network/repos","events_url":"https://api.github.com/users/piction-network/events{/privacy}","received_events_url":"https://api.github.com/users/piction-network/received_events","type":"Organization","site_admin":false},"repo":{"id":137008115,"node_id":"MDEwOlJlcG9zaXRvcnkxMzcwMDgxMTU=","name":"smart-ico","full_name":"piction-network/smart-ico","owner":{"login":"piction-network","id":38724316,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4NzI0MzE2","avatar_url":"https://avatars0.githubusercontent.com/u/38724316?v=4","gravatar_id":"","url":"https://api.github.com/users/piction-network","html_url":"https://github.com/piction-network","followers_url":"https://api.github.com/users/piction-network/followers","following_url":"https://api.github.com/users/piction-network/following{/other_user}","gists_url":"https://api.github.com/users/piction-network/gists{/gist_id}","starred_url":"https://api.github.com/users/piction-network/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piction-network/subscriptions","organizations_url":"https://api.github.com/users/piction-network/orgs","repos_url":"https://api.github.com/users/piction-network/repos","events_url":"https://api.github.com/users/piction-network/events{/privacy}","received_events_url":"https://api.github.com/users/piction-network/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/piction-network/smart-ico","description":"smart-ico","fork":false,"url":"https://api.github.com/repos/piction-network/smart-ico","forks_url":"https://api.github.com/repos/piction-network/smart-ico/forks","keys_url":"https://api.github.com/repos/piction-network/smart-ico/keys{/key_id}","collaborators_url":"https://api.github.com/repos/piction-network/smart-ico/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/piction-network/smart-ico/teams","hooks_url":"https://api.github.com/repos/piction-network/smart-ico/hooks","issue_events_url":"https://api.github.com/repos/piction-network/smart-ico/issues/events{/number}","events_url":"https://api.github.com/repos/piction-network/smart-ico/events","assignees_url":"https://api.github.com/repos/piction-network/smart-ico/assignees{/user}","branches_url":"https://api.github.com/repos/piction-network/smart-ico/branches{/branch}","tags_url":"https://api.github.com/repos/piction-network/smart-ico/tags","blobs_url":"https://api.github.com/repos/piction-network/smart-ico/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/piction-network/smart-ico/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/piction-network/smart-ico/git/refs{/sha}","trees_url":"https://api.github.com/repos/piction-network/smart-ico/git/trees{/sha}","statuses_url":"https://api.github.com/repos/piction-network/smart-ico/statuses/{sha}","languages_url":"https://api.github.com/repos/piction-network/smart-ico/languages","stargazers_url":"https://api.github.com/repos/piction-network/smart-ico/stargazers","contributors_url":"https://api.github.com/repos/piction-network/smart-ico/contributors","subscribers_url":"https://api.github.com/repos/piction-network/smart-ico/subscribers","subscription_url":"https://api.github.com/repos/piction-network/smart-ico/subscription","commits_url":"https://api.github.com/repos/piction-network/smart-ico/commits{/sha}","git_commits_url":"https://api.github.com/repos/piction-network/smart-ico/git/commits{/sha}","comments_url":"https://api.github.com/repos/piction-network/smart-ico/comments{/number}","issue_comment_url":"https://api.github.com/repos/piction-network/smart-ico/issues/comments{/number}","contents_url":"https://api.github.com/repos/piction-network/smart-ico/contents/{+path}","compare_url":"https://api.github.com/repos/piction-network/smart-ico/compare/{base}...{head}","merges_url":"https://api.github.com/repos/piction-network/smart-ico/merges","archive_url":"https://api.github.com/repos/piction-network/smart-ico/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/piction-network/smart-ico/downloads","issues_url":"https://api.github.com/repos/piction-network/smart-ico/issues{/number}","pulls_url":"https://api.github.com/repos/piction-network/smart-ico/pulls{/number}","milestones_url":"https://api.github.com/repos/piction-network/smart-ico/milestones{/number}","notifications_url":"https://api.github.com/repos/piction-network/smart-ico/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/piction-network/smart-ico/labels{/name}","releases_url":"https://api.github.com/repos/piction-network/smart-ico/releases{/id}","deployments_url":"https://api.github.com/repos/piction-network/smart-ico/deployments","created_at":"2018-06-12T02:47:09Z","updated_at":"2018-06-20T06:46:14Z","pushed_at":"2018-06-20T08:03:57Z","git_url":"git://github.com/piction-network/smart-ico.git","ssh_url":"git@github.com:piction-network/smart-ico.git","clone_url":"https://github.com/piction-network/smart-ico.git","svn_url":"https://github.com/piction-network/smart-ico","homepage":null,"size":123,"stargazers_count":0,"watchers_count":0,"language":"Solidity","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/piction-network/smart-ico/pulls/18"},"html":{"href":"https://github.com/piction-network/smart-ico/pull/18"},"issue":{"href":"https://api.github.com/repos/piction-network/smart-ico/issues/18"},"comments":{"href":"https://api.github.com/repos/piction-network/smart-ico/issues/18/comments"},"review_comments":{"href":"https://api.github.com/repos/piction-network/smart-ico/pulls/18/comments"},"review_comment":{"href":"https://api.github.com/repos/piction-network/smart-ico/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/piction-network/smart-ico/pulls/18/commits"},"statuses":{"href":"https://api.github.com/repos/piction-network/smart-ico/statuses/5024e1c2c8aca2ff9706071fd937ebbe53d023ac"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"charlskim"}}