{"action":"created","comment":{"url":"https://api.github.com/repos/BOLT-Protocol/contracts/pulls/comments/243169402","pull_request_review_id":186865579,"id":243169402,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MzE2OTQwMg==","diff_hunk":"@@ -393,55 +443,167 @@ contract Booster {\n     }\n \n     // deprecated function (only for QA)\n-    function setStagePeriod (uint256 period) public {\n+    function setStagePeriod (uint256 period) public contractOpend {\n         stagePeriod = period;\n     }\n \n     function checkStageTimeout () public view returns (bool) {\n         return block.timestamp > stages[stageHeight].attachTimestamp + (stagePeriod * 3/2);\n     }\n \n-    function finalizeStage () public onlyGoblin {\n+    function finalizeStage () public onlyGoblin contractOpend {\n         // challenge time = 0.2 * stagePeriod Time.\n-        Util.Stage memory currentStage = stages[stageHeight];\n+        // stage has not been attached or still in challenge time\n         require(\n-            currentStage.attachTimestamp > 0 &&\n-            block.timestamp > currentStage.attachTimestamp + (stagePeriod * 1/5),\n-            \"Can't finalize until challenge time up.\"\n-        );\n-        require(currentStage.finalizeTimestamp == 0, \"already finalized.\");\n-        for (uint i = 0; i < currentStage.challengedInfos.length; i++) {\n-            require(currentStage.challengedInfos[i].challengedState == true, \"Challenge hasn't been closed.\");\n+            stages[stageHeight].attachTimestamp > 0 &&\n+            block.timestamp > stages[stageHeight].attachTimestamp + (stagePeriod * 1/5));\n+        //stage has already finalized.\n+        require(stages[stageHeight].finalizeTimestamp == 0);\n+        // Challenge hasn't been closed.\n+       for (uint i = 0; i < stages[stageHeight].challengedInfos.length; i++) {\n+            if (stages[stageHeight].challengedInfos[i].challengedState == false) {\n+                // Challenge hasn't been closed.\n+                revert();\n+            }\n         }\n+        // require(stages[stageHeight].challengedInfos[i].challengedState == true, \"Challenge hasn't been closed.\");\n         stages[stageHeight].finalizeTimestamp = block.timestamp;\n         emit Finalize (bytes32(stageHeight));\n     }\n \n-    function getInsuranceBalance(address tokenAddress) public view returns (uint256) {\n-        // what if eth?\n-        require(assetAddresses[tokenAddress] == true, \"token not supported\");\n-        return insurances[tokenAddress];\n-    }\n+    // function getInsuranceBalance(address tokenAddress) public view returns (uint256) {\n+    //     // what if eth?\n+    //     // token not supported\n+    //     require(assetAddresses[tokenAddress] == true);\n+    //     return insurances[tokenAddress];\n+    // }\n  \n-    function putInsurance(address tokenAddress, uint256 amount) public payable {\n-        if (msg.value != 0) {\n-            // received Eth\n-            insurances[address(0)] = insurances[address(0)].add(msg.value);\n-        } else {\n-            // received erc20 and erc223\n-            require(assetAddresses[tokenAddress] == true, \"token not supported\");\n-            require(Token(tokenAddress).transferFrom(msg.sender, this, amount), \"Approve failed.\");\n-            insurances[tokenAddress] = insurances[tokenAddress].add(amount);\n-        }\n-    }\n-\n-    function attachBoosterModule(bytes32 moduleName, address moduleAddress) public onlyOwner {\n+    // function putInsurance(address tokenAddress, uint256 amount) public payable contractOpend {\n+    //     if (msg.value != 0) {\n+    //         // received Eth\n+    //         insurances[address(0)] = insurances[address(0)].add(msg.value);\n+    //     } else {\n+    //         // received erc20 and erc223\n+    //         // token not supported\n+    //         require(assetAddresses[tokenAddress] == true, \"token not supported\");\n+    //         // Approve failed\n+    //         require(Token(tokenAddress).transferFrom(msg.sender, this, amount));\n+    //         insurances[tokenAddress] = insurances[tokenAddress].add(amount);\n+    //     }\n+    // }\n+\n+    function attachBoosterModule(bytes32 moduleName, address moduleAddress) public onlyOwner contractOpend {\n         modules[moduleName] = moduleAddress;\n         emit AttachBoosterModule(moduleName, moduleAddress);\n     }\n \n-    function callModule(bytes32 moduleName, bytes32[] params) internal returns(bytes32) {\n+    function callModule(bytes32 moduleName, bytes32[] params) internal contractOpend returns(bytes32) {\n         bytes32 result = BoosterModule(modules[moduleName]).run(params);\n         return result;\n     }\n+    \n+    // migrate\n+    function setMigratingTo(address newContractAddress_) public onlyOwner {\n+        // already have new contract address\n+        require(newContractAddress == address(0));\n+        newContractAddress = newContractAddress_;\n+    }\n+\n+    function setMigratingFrom(address oldContractAddress_) public onlyOwner {","path":"contracts/Booster.sol","position":412,"original_position":412,"commit_id":"6c6ca57d7db90fc069f0e265745e4faa049eedea","original_commit_id":"6c6ca57d7db90fc069f0e265745e4faa049eedea","user":{"login":"EuroHsu","id":31313756,"node_id":"MDQ6VXNlcjMxMzEzNzU2","avatar_url":"https://avatars2.githubusercontent.com/u/31313756?v=4","gravatar_id":"","url":"https://api.github.com/users/EuroHsu","html_url":"https://github.com/EuroHsu","followers_url":"https://api.github.com/users/EuroHsu/followers","following_url":"https://api.github.com/users/EuroHsu/following{/other_user}","gists_url":"https://api.github.com/users/EuroHsu/gists{/gist_id}","starred_url":"https://api.github.com/users/EuroHsu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EuroHsu/subscriptions","organizations_url":"https://api.github.com/users/EuroHsu/orgs","repos_url":"https://api.github.com/users/EuroHsu/repos","events_url":"https://api.github.com/users/EuroHsu/events{/privacy}","received_events_url":"https://api.github.com/users/EuroHsu/received_events","type":"User","site_admin":false},"body":"onlyOwner? onlyGoblin?","created_at":"2018-12-20T06:46:36Z","updated_at":"2018-12-20T06:46:36Z","html_url":"https://github.com/BOLT-Protocol/contracts/pull/67#discussion_r243169402","pull_request_url":"https://api.github.com/repos/BOLT-Protocol/contracts/pulls/67","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/BOLT-Protocol/contracts/pulls/comments/243169402"},"html":{"href":"https://github.com/BOLT-Protocol/contracts/pull/67#discussion_r243169402"},"pull_request":{"href":"https://api.github.com/repos/BOLT-Protocol/contracts/pulls/67"}}},"pull_request":{"url":"https://api.github.com/repos/BOLT-Protocol/contracts/pulls/67","id":240044549,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQwMDQ0NTQ5","html_url":"https://github.com/BOLT-Protocol/contracts/pull/67","diff_url":"https://github.com/BOLT-Protocol/contracts/pull/67.diff","patch_url":"https://github.com/BOLT-Protocol/contracts/pull/67.patch","issue_url":"https://api.github.com/repos/BOLT-Protocol/contracts/issues/67","number":67,"state":"open","locked":false,"title":"Feature/migration","user":{"login":"Derek-Chiu","id":14184786,"node_id":"MDQ6VXNlcjE0MTg0Nzg2","avatar_url":"https://avatars2.githubusercontent.com/u/14184786?v=4","gravatar_id":"","url":"https://api.github.com/users/Derek-Chiu","html_url":"https://github.com/Derek-Chiu","followers_url":"https://api.github.com/users/Derek-Chiu/followers","following_url":"https://api.github.com/users/Derek-Chiu/following{/other_user}","gists_url":"https://api.github.com/users/Derek-Chiu/gists{/gist_id}","starred_url":"https://api.github.com/users/Derek-Chiu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Derek-Chiu/subscriptions","organizations_url":"https://api.github.com/users/Derek-Chiu/orgs","repos_url":"https://api.github.com/users/Derek-Chiu/repos","events_url":"https://api.github.com/users/Derek-Chiu/events{/privacy}","received_events_url":"https://api.github.com/users/Derek-Chiu/received_events","type":"User","site_admin":false},"body":"Merge migrate and down gas refactoring to Dev","created_at":"2018-12-20T03:52:07Z","updated_at":"2018-12-20T06:46:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"98c51bbe39dfc1fc325d39e19079e2d375b68beb","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/BOLT-Protocol/contracts/pulls/67/commits","review_comments_url":"https://api.github.com/repos/BOLT-Protocol/contracts/pulls/67/comments","review_comment_url":"https://api.github.com/repos/BOLT-Protocol/contracts/pulls/comments{/number}","comments_url":"https://api.github.com/repos/BOLT-Protocol/contracts/issues/67/comments","statuses_url":"https://api.github.com/repos/BOLT-Protocol/contracts/statuses/6c6ca57d7db90fc069f0e265745e4faa049eedea","head":{"label":"BOLT-Protocol:feature/migration","ref":"feature/migration","sha":"6c6ca57d7db90fc069f0e265745e4faa049eedea","user":{"login":"BOLT-Protocol","id":35829226,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1ODI5MjI2","avatar_url":"https://avatars1.githubusercontent.com/u/35829226?v=4","gravatar_id":"","url":"https://api.github.com/users/BOLT-Protocol","html_url":"https://github.com/BOLT-Protocol","followers_url":"https://api.github.com/users/BOLT-Protocol/followers","following_url":"https://api.github.com/users/BOLT-Protocol/following{/other_user}","gists_url":"https://api.github.com/users/BOLT-Protocol/gists{/gist_id}","starred_url":"https://api.github.com/users/BOLT-Protocol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BOLT-Protocol/subscriptions","organizations_url":"https://api.github.com/users/BOLT-Protocol/orgs","repos_url":"https://api.github.com/users/BOLT-Protocol/repos","events_url":"https://api.github.com/users/BOLT-Protocol/events{/privacy}","received_events_url":"https://api.github.com/users/BOLT-Protocol/received_events","type":"Organization","site_admin":false},"repo":{"id":127741009,"node_id":"MDEwOlJlcG9zaXRvcnkxMjc3NDEwMDk=","name":"contracts","full_name":"BOLT-Protocol/contracts","private":false,"owner":{"login":"BOLT-Protocol","id":35829226,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1ODI5MjI2","avatar_url":"https://avatars1.githubusercontent.com/u/35829226?v=4","gravatar_id":"","url":"https://api.github.com/users/BOLT-Protocol","html_url":"https://github.com/BOLT-Protocol","followers_url":"https://api.github.com/users/BOLT-Protocol/followers","following_url":"https://api.github.com/users/BOLT-Protocol/following{/other_user}","gists_url":"https://api.github.com/users/BOLT-Protocol/gists{/gist_id}","starred_url":"https://api.github.com/users/BOLT-Protocol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BOLT-Protocol/subscriptions","organizations_url":"https://api.github.com/users/BOLT-Protocol/orgs","repos_url":"https://api.github.com/users/BOLT-Protocol/repos","events_url":"https://api.github.com/users/BOLT-Protocol/events{/privacy}","received_events_url":"https://api.github.com/users/BOLT-Protocol/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/BOLT-Protocol/contracts","description":"Contract of BOLT Protocol","fork":false,"url":"https://api.github.com/repos/BOLT-Protocol/contracts","forks_url":"https://api.github.com/repos/BOLT-Protocol/contracts/forks","keys_url":"https://api.github.com/repos/BOLT-Protocol/contracts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BOLT-Protocol/contracts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BOLT-Protocol/contracts/teams","hooks_url":"https://api.github.com/repos/BOLT-Protocol/contracts/hooks","issue_events_url":"https://api.github.com/repos/BOLT-Protocol/contracts/issues/events{/number}","events_url":"https://api.github.com/repos/BOLT-Protocol/contracts/events","assignees_url":"https://api.github.com/repos/BOLT-Protocol/contracts/assignees{/user}","branches_url":"https://api.github.com/repos/BOLT-Protocol/contracts/branches{/branch}","tags_url":"https://api.github.com/repos/BOLT-Protocol/contracts/tags","blobs_url":"https://api.github.com/repos/BOLT-Protocol/contracts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BOLT-Protocol/contracts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BOLT-Protocol/contracts/git/refs{/sha}","trees_url":"https://api.github.com/repos/BOLT-Protocol/contracts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BOLT-Protocol/contracts/statuses/{sha}","languages_url":"https://api.github.com/repos/BOLT-Protocol/contracts/languages","stargazers_url":"https://api.github.com/repos/BOLT-Protocol/contracts/stargazers","contributors_url":"https://api.github.com/repos/BOLT-Protocol/contracts/contributors","subscribers_url":"https://api.github.com/repos/BOLT-Protocol/contracts/subscribers","subscription_url":"https://api.github.com/repos/BOLT-Protocol/contracts/subscription","commits_url":"https://api.github.com/repos/BOLT-Protocol/contracts/commits{/sha}","git_commits_url":"https://api.github.com/repos/BOLT-Protocol/contracts/git/commits{/sha}","comments_url":"https://api.github.com/repos/BOLT-Protocol/contracts/comments{/number}","issue_comment_url":"https://api.github.com/repos/BOLT-Protocol/contracts/issues/comments{/number}","contents_url":"https://api.github.com/repos/BOLT-Protocol/contracts/contents/{+path}","compare_url":"https://api.github.com/repos/BOLT-Protocol/contracts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BOLT-Protocol/contracts/merges","archive_url":"https://api.github.com/repos/BOLT-Protocol/contracts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BOLT-Protocol/contracts/downloads","issues_url":"https://api.github.com/repos/BOLT-Protocol/contracts/issues{/number}","pulls_url":"https://api.github.com/repos/BOLT-Protocol/contracts/pulls{/number}","milestones_url":"https://api.github.com/repos/BOLT-Protocol/contracts/milestones{/number}","notifications_url":"https://api.github.com/repos/BOLT-Protocol/contracts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BOLT-Protocol/contracts/labels{/name}","releases_url":"https://api.github.com/repos/BOLT-Protocol/contracts/releases{/id}","deployments_url":"https://api.github.com/repos/BOLT-Protocol/contracts/deployments","created_at":"2018-04-02T10:24:12Z","updated_at":"2018-12-05T09:28:04Z","pushed_at":"2018-12-20T06:19:28Z","git_url":"git://github.com/BOLT-Protocol/contracts.git","ssh_url":"git@github.com:BOLT-Protocol/contracts.git","clone_url":"https://github.com/BOLT-Protocol/contracts.git","svn_url":"https://github.com/BOLT-Protocol/contracts","homepage":"","size":374,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":6,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":2,"open_issues":6,"watchers":2,"default_branch":"master"}},"base":{"label":"BOLT-Protocol:master","ref":"master","sha":"ab83c32df04d0fb969370765bfc8aa21e529f5c9","user":{"login":"BOLT-Protocol","id":35829226,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1ODI5MjI2","avatar_url":"https://avatars1.githubusercontent.com/u/35829226?v=4","gravatar_id":"","url":"https://api.github.com/users/BOLT-Protocol","html_url":"https://github.com/BOLT-Protocol","followers_url":"https://api.github.com/users/BOLT-Protocol/followers","following_url":"https://api.github.com/users/BOLT-Protocol/following{/other_user}","gists_url":"https://api.github.com/users/BOLT-Protocol/gists{/gist_id}","starred_url":"https://api.github.com/users/BOLT-Protocol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BOLT-Protocol/subscriptions","organizations_url":"https://api.github.com/users/BOLT-Protocol/orgs","repos_url":"https://api.github.com/users/BOLT-Protocol/repos","events_url":"https://api.github.com/users/BOLT-Protocol/events{/privacy}","received_events_url":"https://api.github.com/users/BOLT-Protocol/received_events","type":"Organization","site_admin":false},"repo":{"id":127741009,"node_id":"MDEwOlJlcG9zaXRvcnkxMjc3NDEwMDk=","name":"contracts","full_name":"BOLT-Protocol/contracts","private":false,"owner":{"login":"BOLT-Protocol","id":35829226,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1ODI5MjI2","avatar_url":"https://avatars1.githubusercontent.com/u/35829226?v=4","gravatar_id":"","url":"https://api.github.com/users/BOLT-Protocol","html_url":"https://github.com/BOLT-Protocol","followers_url":"https://api.github.com/users/BOLT-Protocol/followers","following_url":"https://api.github.com/users/BOLT-Protocol/following{/other_user}","gists_url":"https://api.github.com/users/BOLT-Protocol/gists{/gist_id}","starred_url":"https://api.github.com/users/BOLT-Protocol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BOLT-Protocol/subscriptions","organizations_url":"https://api.github.com/users/BOLT-Protocol/orgs","repos_url":"https://api.github.com/users/BOLT-Protocol/repos","events_url":"https://api.github.com/users/BOLT-Protocol/events{/privacy}","received_events_url":"https://api.github.com/users/BOLT-Protocol/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/BOLT-Protocol/contracts","description":"Contract of BOLT Protocol","fork":false,"url":"https://api.github.com/repos/BOLT-Protocol/contracts","forks_url":"https://api.github.com/repos/BOLT-Protocol/contracts/forks","keys_url":"https://api.github.com/repos/BOLT-Protocol/contracts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BOLT-Protocol/contracts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BOLT-Protocol/contracts/teams","hooks_url":"https://api.github.com/repos/BOLT-Protocol/contracts/hooks","issue_events_url":"https://api.github.com/repos/BOLT-Protocol/contracts/issues/events{/number}","events_url":"https://api.github.com/repos/BOLT-Protocol/contracts/events","assignees_url":"https://api.github.com/repos/BOLT-Protocol/contracts/assignees{/user}","branches_url":"https://api.github.com/repos/BOLT-Protocol/contracts/branches{/branch}","tags_url":"https://api.github.com/repos/BOLT-Protocol/contracts/tags","blobs_url":"https://api.github.com/repos/BOLT-Protocol/contracts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BOLT-Protocol/contracts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BOLT-Protocol/contracts/git/refs{/sha}","trees_url":"https://api.github.com/repos/BOLT-Protocol/contracts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BOLT-Protocol/contracts/statuses/{sha}","languages_url":"https://api.github.com/repos/BOLT-Protocol/contracts/languages","stargazers_url":"https://api.github.com/repos/BOLT-Protocol/contracts/stargazers","contributors_url":"https://api.github.com/repos/BOLT-Protocol/contracts/contributors","subscribers_url":"https://api.github.com/repos/BOLT-Protocol/contracts/subscribers","subscription_url":"https://api.github.com/repos/BOLT-Protocol/contracts/subscription","commits_url":"https://api.github.com/repos/BOLT-Protocol/contracts/commits{/sha}","git_commits_url":"https://api.github.com/repos/BOLT-Protocol/contracts/git/commits{/sha}","comments_url":"https://api.github.com/repos/BOLT-Protocol/contracts/comments{/number}","issue_comment_url":"https://api.github.com/repos/BOLT-Protocol/contracts/issues/comments{/number}","contents_url":"https://api.github.com/repos/BOLT-Protocol/contracts/contents/{+path}","compare_url":"https://api.github.com/repos/BOLT-Protocol/contracts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BOLT-Protocol/contracts/merges","archive_url":"https://api.github.com/repos/BOLT-Protocol/contracts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BOLT-Protocol/contracts/downloads","issues_url":"https://api.github.com/repos/BOLT-Protocol/contracts/issues{/number}","pulls_url":"https://api.github.com/repos/BOLT-Protocol/contracts/pulls{/number}","milestones_url":"https://api.github.com/repos/BOLT-Protocol/contracts/milestones{/number}","notifications_url":"https://api.github.com/repos/BOLT-Protocol/contracts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BOLT-Protocol/contracts/labels{/name}","releases_url":"https://api.github.com/repos/BOLT-Protocol/contracts/releases{/id}","deployments_url":"https://api.github.com/repos/BOLT-Protocol/contracts/deployments","created_at":"2018-04-02T10:24:12Z","updated_at":"2018-12-05T09:28:04Z","pushed_at":"2018-12-20T06:19:28Z","git_url":"git://github.com/BOLT-Protocol/contracts.git","ssh_url":"git@github.com:BOLT-Protocol/contracts.git","clone_url":"https://github.com/BOLT-Protocol/contracts.git","svn_url":"https://github.com/BOLT-Protocol/contracts","homepage":"","size":374,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":6,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":2,"open_issues":6,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/BOLT-Protocol/contracts/pulls/67"},"html":{"href":"https://github.com/BOLT-Protocol/contracts/pull/67"},"issue":{"href":"https://api.github.com/repos/BOLT-Protocol/contracts/issues/67"},"comments":{"href":"https://api.github.com/repos/BOLT-Protocol/contracts/issues/67/comments"},"review_comments":{"href":"https://api.github.com/repos/BOLT-Protocol/contracts/pulls/67/comments"},"review_comment":{"href":"https://api.github.com/repos/BOLT-Protocol/contracts/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/BOLT-Protocol/contracts/pulls/67/commits"},"statuses":{"href":"https://api.github.com/repos/BOLT-Protocol/contracts/statuses/6c6ca57d7db90fc069f0e265745e4faa049eedea"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"EuroHsu"}}