{"action":"created","comment":{"url":"https://api.github.com/repos/hubiinetwork/striim-contracts/pulls/comments/205627874","pull_request_review_id":140939332,"id":205627874,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNTYyNzg3NA==","diff_hunk":"@@ -0,0 +1,121 @@\n+/*\n+ * Hubii Striim\n+ *\n+ * Compliant with the Hubii Striim specification v0.12.\n+ *\n+ * Copyright (C) 2017-2018 Hubii AS\n+ */\n+\n+pragma solidity ^0.4.24;\n+\n+import {Ownable} from \"./Ownable.sol\";\n+import {SelfDestructible} from \"./SelfDestructible.sol\";\n+import \"./ERC20Controller.sol\";\n+import \"./ERC721Controller.sol\";\n+\n+/**\n+@title TokenManager\n+@notice Handles registration of tokens\n+*/\n+contract TokenManager is Ownable, SelfDestructible {\n+    //\n+    // Constants\n+    // -----------------------------------------------------------------------------------------------------------------\n+    uint32 constant BLACKLISTED = 2147483648;\n+\n+    //\n+    // Variables\n+    // -----------------------------------------------------------------------------------------------------------------\n+    mapping(uint32 => address) registeredInterfaces;\n+    mapping(address => uint32) registeredTokens;\n+\n+    //\n+    // Events\n+    // -----------------------------------------------------------------------------------------------------------------\n+    event RegisteredInterface(uint32 _id, address _interface);\n+    event DeregisteredInterface(uint32 _id);\n+\n+    event RegisteredToken(address token, uint32 interface_id);\n+    event DeregisteredToken(address token);\n+    event BlacklistedToken(address token);\n+    event WhitelistedToken(address token);\n+\n+    //\n+    // Constructor\n+    // -----------------------------------------------------------------------------------------------------------------\n+    constructor(address owner) Ownable(owner) public {\n+    }\n+\n+    //\n+    // Functions\n+    // -----------------------------------------------------------------------------------------------------------------\n+    function registerInterface(uint32 _id, address _interface) external onlyOwner {\n+        require(_id >= 1 && _id <= 1048576);\n+        require(_interface != address(0));\n+        require(registeredInterfaces[_id] == address(0));\n+\n+        registeredInterfaces[_id] = _interface;\n+\n+        //raise event\n+        emit RegisteredInterface(_id, _interface);\n+    }\n+\n+    function deregisterInterface(uint32 _id) external onlyOwner {\n+        require(registeredInterfaces[_id] != address(0));\n+\n+        registeredInterfaces[_id] = address(0);\n+\n+        //raise event\n+        emit DeregisteredInterface(_id);\n+    }\n+\n+    function registerToken(address token, uint32 interface_id) external onlyOwner {\n+        require(token != address(0));\n+        require(interface_id >= 1 && interface_id <= 1048576);\n+        require(registeredTokens[token] == 0);\n+\n+        registeredTokens[token] = interface_id;\n+\n+        //raise event\n+        emit RegisteredToken(token, interface_id);\n+    }\n+\n+    function deregisterToken(address token) external onlyOwner {\n+        require(token != address(0));\n+        require(registeredTokens[token] != 0);\n+\n+        registeredTokens[token] = 0;\n+\n+        //raise event\n+        emit DeregisteredToken(token);\n+    }\n+\n+    function blacklistToken(address token) external onlyOwner {\n+        require(token != address(0));\n+        require(registeredTokens[token] != 0);\n+\n+        registeredTokens[token] = registeredTokens[token] | BLACKLISTED;\n+\n+        //raise event\n+        emit BlacklistedToken(token);\n+    }\n+\n+    function whitelistToken(address token) external onlyOwner {\n+        require(token != address(0));\n+        require(registeredTokens[token] != 0);\n+\n+        registeredTokens[token] = registeredTokens[token] & (~BLACKLISTED);\n+\n+        //raise event\n+        emit WhitelistedToken(token);\n+    }\n+\n+    function getInferface(address token) public view returns (TokenTypeInterface) {","path":"contracts/TokenManager.sol","position":113,"original_position":113,"commit_id":"2abc70feae32b55b5ec0deca24c32bb69c9694dc","original_commit_id":"2abc70feae32b55b5ec0deca24c32bb69c9694dc","user":{"login":"mxmauro","id":1683070,"node_id":"MDQ6VXNlcjE2ODMwNzA=","avatar_url":"https://avatars3.githubusercontent.com/u/1683070?v=4","gravatar_id":"","url":"https://api.github.com/users/mxmauro","html_url":"https://github.com/mxmauro","followers_url":"https://api.github.com/users/mxmauro/followers","following_url":"https://api.github.com/users/mxmauro/following{/other_user}","gists_url":"https://api.github.com/users/mxmauro/gists{/gist_id}","starred_url":"https://api.github.com/users/mxmauro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mxmauro/subscriptions","organizations_url":"https://api.github.com/users/mxmauro/orgs","repos_url":"https://api.github.com/users/mxmauro/repos","events_url":"https://api.github.com/users/mxmauro/events{/privacy}","received_events_url":"https://api.github.com/users/mxmauro/received_events","type":"User","site_admin":false},"body":"👍 \r\n","created_at":"2018-07-26T23:07:10Z","updated_at":"2018-07-26T23:07:10Z","html_url":"https://github.com/hubiinetwork/striim-contracts/pull/124#discussion_r205627874","pull_request_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/pulls/124","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/hubiinetwork/striim-contracts/pulls/comments/205627874"},"html":{"href":"https://github.com/hubiinetwork/striim-contracts/pull/124#discussion_r205627874"},"pull_request":{"href":"https://api.github.com/repos/hubiinetwork/striim-contracts/pulls/124"}},"in_reply_to_id":205626011},"pull_request":{"url":"https://api.github.com/repos/hubiinetwork/striim-contracts/pulls/124","id":203911569,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAzOTExNTY5","html_url":"https://github.com/hubiinetwork/striim-contracts/pull/124","diff_url":"https://github.com/hubiinetwork/striim-contracts/pull/124.diff","patch_url":"https://github.com/hubiinetwork/striim-contracts/pull/124.patch","issue_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/issues/124","number":124,"state":"open","locked":false,"title":"WIP: Token transfer controller","user":{"login":"mxmauro","id":1683070,"node_id":"MDQ6VXNlcjE2ODMwNzA=","avatar_url":"https://avatars3.githubusercontent.com/u/1683070?v=4","gravatar_id":"","url":"https://api.github.com/users/mxmauro","html_url":"https://github.com/mxmauro","followers_url":"https://api.github.com/users/mxmauro/followers","following_url":"https://api.github.com/users/mxmauro/following{/other_user}","gists_url":"https://api.github.com/users/mxmauro/gists{/gist_id}","starred_url":"https://api.github.com/users/mxmauro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mxmauro/subscriptions","organizations_url":"https://api.github.com/users/mxmauro/orgs","repos_url":"https://api.github.com/users/mxmauro/repos","events_url":"https://api.github.com/users/mxmauro/events{/privacy}","received_events_url":"https://api.github.com/users/mxmauro/received_events","type":"User","site_admin":false},"body":"The initial draft for doing token transfers of different types.\r\n\r\n1. Separated `receive`/`send` so we use the same contract transfer function for doing withdrawal in case the `transfer` function is not correctly implemented.\r\n2. EIP1155 is in a veeeeery alpha stage to implement some handler.\r\n3. Because the different kind of token contracts, added two helper functions to determine if a token is transferred in terms of quantity and/or id.\r\n\r\nTo-do next: Add the token registration. Unregistered tokens cannot be used in the exchange and the backend will be in charge of registering tokens and types into the system.","created_at":"2018-07-25T17:38:37Z","updated_at":"2018-07-26T23:07:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cd64505933d420b461e1711c2dcaf8c41e1932a9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/pulls/124/commits","review_comments_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/pulls/124/comments","review_comment_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/issues/124/comments","statuses_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/statuses/2abc70feae32b55b5ec0deca24c32bb69c9694dc","head":{"label":"hubiinetwork:feature/token_interfaces","ref":"feature/token_interfaces","sha":"2abc70feae32b55b5ec0deca24c32bb69c9694dc","user":{"login":"hubiinetwork","id":31890725,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxODkwNzI1","avatar_url":"https://avatars2.githubusercontent.com/u/31890725?v=4","gravatar_id":"","url":"https://api.github.com/users/hubiinetwork","html_url":"https://github.com/hubiinetwork","followers_url":"https://api.github.com/users/hubiinetwork/followers","following_url":"https://api.github.com/users/hubiinetwork/following{/other_user}","gists_url":"https://api.github.com/users/hubiinetwork/gists{/gist_id}","starred_url":"https://api.github.com/users/hubiinetwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hubiinetwork/subscriptions","organizations_url":"https://api.github.com/users/hubiinetwork/orgs","repos_url":"https://api.github.com/users/hubiinetwork/repos","events_url":"https://api.github.com/users/hubiinetwork/events{/privacy}","received_events_url":"https://api.github.com/users/hubiinetwork/received_events","type":"Organization","site_admin":false},"repo":{"id":114408004,"node_id":"MDEwOlJlcG9zaXRvcnkxMTQ0MDgwMDQ=","name":"striim-contracts","full_name":"hubiinetwork/striim-contracts","owner":{"login":"hubiinetwork","id":31890725,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxODkwNzI1","avatar_url":"https://avatars2.githubusercontent.com/u/31890725?v=4","gravatar_id":"","url":"https://api.github.com/users/hubiinetwork","html_url":"https://github.com/hubiinetwork","followers_url":"https://api.github.com/users/hubiinetwork/followers","following_url":"https://api.github.com/users/hubiinetwork/following{/other_user}","gists_url":"https://api.github.com/users/hubiinetwork/gists{/gist_id}","starred_url":"https://api.github.com/users/hubiinetwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hubiinetwork/subscriptions","organizations_url":"https://api.github.com/users/hubiinetwork/orgs","repos_url":"https://api.github.com/users/hubiinetwork/repos","events_url":"https://api.github.com/users/hubiinetwork/events{/privacy}","received_events_url":"https://api.github.com/users/hubiinetwork/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hubiinetwork/striim-contracts","description":"Smart contracts for the Omphalos Exchange component","fork":false,"url":"https://api.github.com/repos/hubiinetwork/striim-contracts","forks_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/forks","keys_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/teams","hooks_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/hooks","issue_events_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/issues/events{/number}","events_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/events","assignees_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/assignees{/user}","branches_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/branches{/branch}","tags_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/tags","blobs_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/git/refs{/sha}","trees_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/statuses/{sha}","languages_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/languages","stargazers_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/stargazers","contributors_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/contributors","subscribers_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/subscribers","subscription_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/subscription","commits_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/commits{/sha}","git_commits_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/git/commits{/sha}","comments_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/comments{/number}","issue_comment_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/issues/comments{/number}","contents_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/contents/{+path}","compare_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/merges","archive_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/downloads","issues_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/issues{/number}","pulls_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/pulls{/number}","milestones_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/milestones{/number}","notifications_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/labels{/name}","releases_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/releases{/id}","deployments_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/deployments","created_at":"2017-12-15T20:17:54Z","updated_at":"2018-07-19T08:43:41Z","pushed_at":"2018-07-26T14:47:19Z","git_url":"git://github.com/hubiinetwork/striim-contracts.git","ssh_url":"git@github.com:hubiinetwork/striim-contracts.git","clone_url":"https://github.com/hubiinetwork/striim-contracts.git","svn_url":"https://github.com/hubiinetwork/striim-contracts","homepage":"","size":6872,"stargazers_count":8,"watchers_count":8,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":18,"license":null,"forks":1,"open_issues":18,"watchers":8,"default_branch":"develop"}},"base":{"label":"hubiinetwork:develop","ref":"develop","sha":"06155a6acc0bc049e7ab83f7ce48afe910bd0f8b","user":{"login":"hubiinetwork","id":31890725,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxODkwNzI1","avatar_url":"https://avatars2.githubusercontent.com/u/31890725?v=4","gravatar_id":"","url":"https://api.github.com/users/hubiinetwork","html_url":"https://github.com/hubiinetwork","followers_url":"https://api.github.com/users/hubiinetwork/followers","following_url":"https://api.github.com/users/hubiinetwork/following{/other_user}","gists_url":"https://api.github.com/users/hubiinetwork/gists{/gist_id}","starred_url":"https://api.github.com/users/hubiinetwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hubiinetwork/subscriptions","organizations_url":"https://api.github.com/users/hubiinetwork/orgs","repos_url":"https://api.github.com/users/hubiinetwork/repos","events_url":"https://api.github.com/users/hubiinetwork/events{/privacy}","received_events_url":"https://api.github.com/users/hubiinetwork/received_events","type":"Organization","site_admin":false},"repo":{"id":114408004,"node_id":"MDEwOlJlcG9zaXRvcnkxMTQ0MDgwMDQ=","name":"striim-contracts","full_name":"hubiinetwork/striim-contracts","owner":{"login":"hubiinetwork","id":31890725,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxODkwNzI1","avatar_url":"https://avatars2.githubusercontent.com/u/31890725?v=4","gravatar_id":"","url":"https://api.github.com/users/hubiinetwork","html_url":"https://github.com/hubiinetwork","followers_url":"https://api.github.com/users/hubiinetwork/followers","following_url":"https://api.github.com/users/hubiinetwork/following{/other_user}","gists_url":"https://api.github.com/users/hubiinetwork/gists{/gist_id}","starred_url":"https://api.github.com/users/hubiinetwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hubiinetwork/subscriptions","organizations_url":"https://api.github.com/users/hubiinetwork/orgs","repos_url":"https://api.github.com/users/hubiinetwork/repos","events_url":"https://api.github.com/users/hubiinetwork/events{/privacy}","received_events_url":"https://api.github.com/users/hubiinetwork/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hubiinetwork/striim-contracts","description":"Smart contracts for the Omphalos Exchange component","fork":false,"url":"https://api.github.com/repos/hubiinetwork/striim-contracts","forks_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/forks","keys_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/teams","hooks_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/hooks","issue_events_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/issues/events{/number}","events_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/events","assignees_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/assignees{/user}","branches_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/branches{/branch}","tags_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/tags","blobs_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/git/refs{/sha}","trees_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/statuses/{sha}","languages_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/languages","stargazers_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/stargazers","contributors_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/contributors","subscribers_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/subscribers","subscription_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/subscription","commits_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/commits{/sha}","git_commits_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/git/commits{/sha}","comments_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/comments{/number}","issue_comment_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/issues/comments{/number}","contents_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/contents/{+path}","compare_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/merges","archive_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/downloads","issues_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/issues{/number}","pulls_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/pulls{/number}","milestones_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/milestones{/number}","notifications_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/labels{/name}","releases_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/releases{/id}","deployments_url":"https://api.github.com/repos/hubiinetwork/striim-contracts/deployments","created_at":"2017-12-15T20:17:54Z","updated_at":"2018-07-19T08:43:41Z","pushed_at":"2018-07-26T14:47:19Z","git_url":"git://github.com/hubiinetwork/striim-contracts.git","ssh_url":"git@github.com:hubiinetwork/striim-contracts.git","clone_url":"https://github.com/hubiinetwork/striim-contracts.git","svn_url":"https://github.com/hubiinetwork/striim-contracts","homepage":"","size":6872,"stargazers_count":8,"watchers_count":8,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":18,"license":null,"forks":1,"open_issues":18,"watchers":8,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/hubiinetwork/striim-contracts/pulls/124"},"html":{"href":"https://github.com/hubiinetwork/striim-contracts/pull/124"},"issue":{"href":"https://api.github.com/repos/hubiinetwork/striim-contracts/issues/124"},"comments":{"href":"https://api.github.com/repos/hubiinetwork/striim-contracts/issues/124/comments"},"review_comments":{"href":"https://api.github.com/repos/hubiinetwork/striim-contracts/pulls/124/comments"},"review_comment":{"href":"https://api.github.com/repos/hubiinetwork/striim-contracts/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hubiinetwork/striim-contracts/pulls/124/commits"},"statuses":{"href":"https://api.github.com/repos/hubiinetwork/striim-contracts/statuses/2abc70feae32b55b5ec0deca24c32bb69c9694dc"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"mxmauro"}}