{"action":"created","comment":{"url":"https://api.github.com/repos/0xProject/0x-monorepo/pulls/comments/212712044","pull_request_review_id":149407036,"id":212712044,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMjcxMjA0NA==","diff_hunk":"@@ -257,4 +262,78 @@ contract MixinSignatureValidator is\n         // signature was invalid.)\n         revert(\"SIGNATURE_UNSUPPORTED\");\n     }\n+\n+    /// @dev Verifies signature using logic defined by Wallet contract.\n+    /// @param hash Any 32 byte hash.\n+    /// @param walletAddress Address that should have signed the given hash\n+    ///                      and defines its own signature verification method.\n+    /// @param signature Proof that the hash has been signed by signer.\n+    /// @return True if signature is valid for given wallet..\n+    function isValidWalletSignature(\n+        bytes32 hash,\n+        address walletAddress,\n+        bytes signature\n+    )\n+        internal\n+        view\n+        returns (bool isValid)\n+    {\n+        bytes memory calldata = abi.encodeWithSelector(\n+            IWallet(walletAddress).isValidSignature.selector,\n+            hash,\n+            signature\n+        );\n+        assembly {\n+            let cdStart := add(calldata, 32)\n+            let success := staticcall(\n+                gas,              // forward all gas\n+                walletAddress,    // address of Wallet contract\n+                cdStart,          // pointer to start of input\n+                mload(calldata),  // length of input\n+                cdStart,          // write input over output\n+                32                // output size is 32 bytes\n+            )\n+            // Signature is valid if call did not revert and returned true\n+            isValid := and(success, mload(cdStart))","path":"packages/contracts/src/2.0.0/protocol/Exchange/MixinSignatureValidator.sol","position":59,"original_position":59,"commit_id":"6c72d4f76643293d2caa155847a95dd4ea25a297","original_commit_id":"6c72d4f76643293d2caa155847a95dd4ea25a297","user":{"login":"Recmo","id":4532328,"node_id":"MDQ6VXNlcjQ1MzIzMjg=","avatar_url":"https://avatars2.githubusercontent.com/u/4532328?v=4","gravatar_id":"","url":"https://api.github.com/users/Recmo","html_url":"https://github.com/Recmo","followers_url":"https://api.github.com/users/Recmo/followers","following_url":"https://api.github.com/users/Recmo/following{/other_user}","gists_url":"https://api.github.com/users/Recmo/gists{/gist_id}","starred_url":"https://api.github.com/users/Recmo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Recmo/subscriptions","organizations_url":"https://api.github.com/users/Recmo/orgs","repos_url":"https://api.github.com/users/Recmo/repos","events_url":"https://api.github.com/users/Recmo/events{/privacy}","received_events_url":"https://api.github.com/users/Recmo/received_events","type":"User","site_admin":false},"body":"This only works if the called contract returns a non-zero odd number for `true`, like `1`. I'm not sure if the ABI guarantees that boolean true is always encoded as `1` (instead of anything non-zero like in C).\r\n\r\nTo fix we could do `and(success, iszero(iszero(mload(cdStart))))`. ","created_at":"2018-08-24T18:12:08Z","updated_at":"2018-08-24T18:16:16Z","html_url":"https://github.com/0xProject/0x-monorepo/pull/1012#discussion_r212712044","pull_request_url":"https://api.github.com/repos/0xProject/0x-monorepo/pulls/1012","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/0xProject/0x-monorepo/pulls/comments/212712044"},"html":{"href":"https://github.com/0xProject/0x-monorepo/pull/1012#discussion_r212712044"},"pull_request":{"href":"https://api.github.com/repos/0xProject/0x-monorepo/pulls/1012"}}},"pull_request":{"url":"https://api.github.com/repos/0xProject/0x-monorepo/pulls/1012","id":210662083,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEwNjYyMDgz","html_url":"https://github.com/0xProject/0x-monorepo/pull/1012","diff_url":"https://github.com/0xProject/0x-monorepo/pull/1012.diff","patch_url":"https://github.com/0xProject/0x-monorepo/pull/1012.patch","issue_url":"https://api.github.com/repos/0xProject/0x-monorepo/issues/1012","number":1012,"state":"open","locked":false,"title":"Use staticcall for external function calls in MixinSignatureValidator","user":{"login":"abandeali1","id":18060168,"node_id":"MDQ6VXNlcjE4MDYwMTY4","avatar_url":"https://avatars0.githubusercontent.com/u/18060168?v=4","gravatar_id":"","url":"https://api.github.com/users/abandeali1","html_url":"https://github.com/abandeali1","followers_url":"https://api.github.com/users/abandeali1/followers","following_url":"https://api.github.com/users/abandeali1/following{/other_user}","gists_url":"https://api.github.com/users/abandeali1/gists{/gist_id}","starred_url":"https://api.github.com/users/abandeali1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abandeali1/subscriptions","organizations_url":"https://api.github.com/users/abandeali1/orgs","repos_url":"https://api.github.com/users/abandeali1/repos","events_url":"https://api.github.com/users/abandeali1/events{/privacy}","received_events_url":"https://api.github.com/users/abandeali1/received_events","type":"User","site_admin":false},"body":"## Description\r\n\r\n<!--- Describe your changes in detail -->\r\n\r\n## Testing instructions\r\n\r\n<!--- Please describe how reviewers can test your changes -->\r\n\r\n## Types of changes\r\n\r\n<!--- What types of changes does your code introduce? Uncomment all the bullets that apply: -->\r\n\r\n<!-- * Bug fix (non-breaking change which fixes an issue) -->\r\n\r\n<!-- * New feature (non-breaking change which adds functionality) -->\r\n\r\n<!-- * Breaking change (fix or feature that would cause existing functionality to change) -->\r\n\r\n## Checklist:\r\n\r\n<!--- The following points should be used to indicate the progress of your PR.  Put an `x` in all the boxes that apply right now, and come back over time and check them off as you make progress.  If you're unsure about any of these, don't hesitate to ask. We're here to help! -->\r\n\r\n*   [ ] Prefix PR title with `[WIP]` if necessary.\r\n*   [ ] Prefix PR title with bracketed package name(s) corresponding to the changed package(s). For example: `[sol-cov] Fixed bug`.\r\n*   [ ] Add tests to cover changes as needed.\r\n*   [ ] Update documentation as needed.\r\n*   [ ] Add new entries to the relevant CHANGELOG.jsons.\r\n","created_at":"2018-08-24T07:36:30Z","updated_at":"2018-08-24T18:16:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e27ce309436fc40be1aa7d35f38786130de2c7fa","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/0xProject/0x-monorepo/pulls/1012/commits","review_comments_url":"https://api.github.com/repos/0xProject/0x-monorepo/pulls/1012/comments","review_comment_url":"https://api.github.com/repos/0xProject/0x-monorepo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/0xProject/0x-monorepo/issues/1012/comments","statuses_url":"https://api.github.com/repos/0xProject/0x-monorepo/statuses/6c72d4f76643293d2caa155847a95dd4ea25a297","head":{"label":"0xProject:feature/contracts/staticcall","ref":"feature/contracts/staticcall","sha":"6c72d4f76643293d2caa155847a95dd4ea25a297","user":{"login":"0xProject","id":24832717,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0ODMyNzE3","avatar_url":"https://avatars2.githubusercontent.com/u/24832717?v=4","gravatar_id":"","url":"https://api.github.com/users/0xProject","html_url":"https://github.com/0xProject","followers_url":"https://api.github.com/users/0xProject/followers","following_url":"https://api.github.com/users/0xProject/following{/other_user}","gists_url":"https://api.github.com/users/0xProject/gists{/gist_id}","starred_url":"https://api.github.com/users/0xProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0xProject/subscriptions","organizations_url":"https://api.github.com/users/0xProject/orgs","repos_url":"https://api.github.com/users/0xProject/repos","events_url":"https://api.github.com/users/0xProject/events{/privacy}","received_events_url":"https://api.github.com/users/0xProject/received_events","type":"Organization","site_admin":false},"repo":{"id":92181371,"node_id":"MDEwOlJlcG9zaXRvcnk5MjE4MTM3MQ==","name":"0x-monorepo","full_name":"0xProject/0x-monorepo","owner":{"login":"0xProject","id":24832717,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0ODMyNzE3","avatar_url":"https://avatars2.githubusercontent.com/u/24832717?v=4","gravatar_id":"","url":"https://api.github.com/users/0xProject","html_url":"https://github.com/0xProject","followers_url":"https://api.github.com/users/0xProject/followers","following_url":"https://api.github.com/users/0xProject/following{/other_user}","gists_url":"https://api.github.com/users/0xProject/gists{/gist_id}","starred_url":"https://api.github.com/users/0xProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0xProject/subscriptions","organizations_url":"https://api.github.com/users/0xProject/orgs","repos_url":"https://api.github.com/users/0xProject/repos","events_url":"https://api.github.com/users/0xProject/events{/privacy}","received_events_url":"https://api.github.com/users/0xProject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/0xProject/0x-monorepo","description":"0x protocol monorepo - includes our smart contracts and many developer tools","fork":false,"url":"https://api.github.com/repos/0xProject/0x-monorepo","forks_url":"https://api.github.com/repos/0xProject/0x-monorepo/forks","keys_url":"https://api.github.com/repos/0xProject/0x-monorepo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/0xProject/0x-monorepo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/0xProject/0x-monorepo/teams","hooks_url":"https://api.github.com/repos/0xProject/0x-monorepo/hooks","issue_events_url":"https://api.github.com/repos/0xProject/0x-monorepo/issues/events{/number}","events_url":"https://api.github.com/repos/0xProject/0x-monorepo/events","assignees_url":"https://api.github.com/repos/0xProject/0x-monorepo/assignees{/user}","branches_url":"https://api.github.com/repos/0xProject/0x-monorepo/branches{/branch}","tags_url":"https://api.github.com/repos/0xProject/0x-monorepo/tags","blobs_url":"https://api.github.com/repos/0xProject/0x-monorepo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/0xProject/0x-monorepo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/0xProject/0x-monorepo/git/refs{/sha}","trees_url":"https://api.github.com/repos/0xProject/0x-monorepo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/0xProject/0x-monorepo/statuses/{sha}","languages_url":"https://api.github.com/repos/0xProject/0x-monorepo/languages","stargazers_url":"https://api.github.com/repos/0xProject/0x-monorepo/stargazers","contributors_url":"https://api.github.com/repos/0xProject/0x-monorepo/contributors","subscribers_url":"https://api.github.com/repos/0xProject/0x-monorepo/subscribers","subscription_url":"https://api.github.com/repos/0xProject/0x-monorepo/subscription","commits_url":"https://api.github.com/repos/0xProject/0x-monorepo/commits{/sha}","git_commits_url":"https://api.github.com/repos/0xProject/0x-monorepo/git/commits{/sha}","comments_url":"https://api.github.com/repos/0xProject/0x-monorepo/comments{/number}","issue_comment_url":"https://api.github.com/repos/0xProject/0x-monorepo/issues/comments{/number}","contents_url":"https://api.github.com/repos/0xProject/0x-monorepo/contents/{+path}","compare_url":"https://api.github.com/repos/0xProject/0x-monorepo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/0xProject/0x-monorepo/merges","archive_url":"https://api.github.com/repos/0xProject/0x-monorepo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/0xProject/0x-monorepo/downloads","issues_url":"https://api.github.com/repos/0xProject/0x-monorepo/issues{/number}","pulls_url":"https://api.github.com/repos/0xProject/0x-monorepo/pulls{/number}","milestones_url":"https://api.github.com/repos/0xProject/0x-monorepo/milestones{/number}","notifications_url":"https://api.github.com/repos/0xProject/0x-monorepo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/0xProject/0x-monorepo/labels{/name}","releases_url":"https://api.github.com/repos/0xProject/0x-monorepo/releases{/id}","deployments_url":"https://api.github.com/repos/0xProject/0x-monorepo/deployments","created_at":"2017-05-23T14:17:33Z","updated_at":"2018-08-24T18:13:20Z","pushed_at":"2018-08-24T18:14:53Z","git_url":"git://github.com/0xProject/0x-monorepo.git","ssh_url":"git@github.com:0xProject/0x-monorepo.git","clone_url":"https://github.com/0xProject/0x-monorepo.git","svn_url":"https://github.com/0xProject/0x-monorepo","homepage":"","size":56028,"stargazers_count":790,"watchers_count":790,"language":"TypeScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":209,"mirror_url":null,"archived":false,"open_issues_count":47,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":209,"open_issues":47,"watchers":790,"default_branch":"development"}},"base":{"label":"0xProject:development","ref":"development","sha":"1354f794a10dac78e9044804e8474d86810db4e4","user":{"login":"0xProject","id":24832717,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0ODMyNzE3","avatar_url":"https://avatars2.githubusercontent.com/u/24832717?v=4","gravatar_id":"","url":"https://api.github.com/users/0xProject","html_url":"https://github.com/0xProject","followers_url":"https://api.github.com/users/0xProject/followers","following_url":"https://api.github.com/users/0xProject/following{/other_user}","gists_url":"https://api.github.com/users/0xProject/gists{/gist_id}","starred_url":"https://api.github.com/users/0xProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0xProject/subscriptions","organizations_url":"https://api.github.com/users/0xProject/orgs","repos_url":"https://api.github.com/users/0xProject/repos","events_url":"https://api.github.com/users/0xProject/events{/privacy}","received_events_url":"https://api.github.com/users/0xProject/received_events","type":"Organization","site_admin":false},"repo":{"id":92181371,"node_id":"MDEwOlJlcG9zaXRvcnk5MjE4MTM3MQ==","name":"0x-monorepo","full_name":"0xProject/0x-monorepo","owner":{"login":"0xProject","id":24832717,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0ODMyNzE3","avatar_url":"https://avatars2.githubusercontent.com/u/24832717?v=4","gravatar_id":"","url":"https://api.github.com/users/0xProject","html_url":"https://github.com/0xProject","followers_url":"https://api.github.com/users/0xProject/followers","following_url":"https://api.github.com/users/0xProject/following{/other_user}","gists_url":"https://api.github.com/users/0xProject/gists{/gist_id}","starred_url":"https://api.github.com/users/0xProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0xProject/subscriptions","organizations_url":"https://api.github.com/users/0xProject/orgs","repos_url":"https://api.github.com/users/0xProject/repos","events_url":"https://api.github.com/users/0xProject/events{/privacy}","received_events_url":"https://api.github.com/users/0xProject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/0xProject/0x-monorepo","description":"0x protocol monorepo - includes our smart contracts and many developer tools","fork":false,"url":"https://api.github.com/repos/0xProject/0x-monorepo","forks_url":"https://api.github.com/repos/0xProject/0x-monorepo/forks","keys_url":"https://api.github.com/repos/0xProject/0x-monorepo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/0xProject/0x-monorepo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/0xProject/0x-monorepo/teams","hooks_url":"https://api.github.com/repos/0xProject/0x-monorepo/hooks","issue_events_url":"https://api.github.com/repos/0xProject/0x-monorepo/issues/events{/number}","events_url":"https://api.github.com/repos/0xProject/0x-monorepo/events","assignees_url":"https://api.github.com/repos/0xProject/0x-monorepo/assignees{/user}","branches_url":"https://api.github.com/repos/0xProject/0x-monorepo/branches{/branch}","tags_url":"https://api.github.com/repos/0xProject/0x-monorepo/tags","blobs_url":"https://api.github.com/repos/0xProject/0x-monorepo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/0xProject/0x-monorepo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/0xProject/0x-monorepo/git/refs{/sha}","trees_url":"https://api.github.com/repos/0xProject/0x-monorepo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/0xProject/0x-monorepo/statuses/{sha}","languages_url":"https://api.github.com/repos/0xProject/0x-monorepo/languages","stargazers_url":"https://api.github.com/repos/0xProject/0x-monorepo/stargazers","contributors_url":"https://api.github.com/repos/0xProject/0x-monorepo/contributors","subscribers_url":"https://api.github.com/repos/0xProject/0x-monorepo/subscribers","subscription_url":"https://api.github.com/repos/0xProject/0x-monorepo/subscription","commits_url":"https://api.github.com/repos/0xProject/0x-monorepo/commits{/sha}","git_commits_url":"https://api.github.com/repos/0xProject/0x-monorepo/git/commits{/sha}","comments_url":"https://api.github.com/repos/0xProject/0x-monorepo/comments{/number}","issue_comment_url":"https://api.github.com/repos/0xProject/0x-monorepo/issues/comments{/number}","contents_url":"https://api.github.com/repos/0xProject/0x-monorepo/contents/{+path}","compare_url":"https://api.github.com/repos/0xProject/0x-monorepo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/0xProject/0x-monorepo/merges","archive_url":"https://api.github.com/repos/0xProject/0x-monorepo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/0xProject/0x-monorepo/downloads","issues_url":"https://api.github.com/repos/0xProject/0x-monorepo/issues{/number}","pulls_url":"https://api.github.com/repos/0xProject/0x-monorepo/pulls{/number}","milestones_url":"https://api.github.com/repos/0xProject/0x-monorepo/milestones{/number}","notifications_url":"https://api.github.com/repos/0xProject/0x-monorepo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/0xProject/0x-monorepo/labels{/name}","releases_url":"https://api.github.com/repos/0xProject/0x-monorepo/releases{/id}","deployments_url":"https://api.github.com/repos/0xProject/0x-monorepo/deployments","created_at":"2017-05-23T14:17:33Z","updated_at":"2018-08-24T18:13:20Z","pushed_at":"2018-08-24T18:14:53Z","git_url":"git://github.com/0xProject/0x-monorepo.git","ssh_url":"git@github.com:0xProject/0x-monorepo.git","clone_url":"https://github.com/0xProject/0x-monorepo.git","svn_url":"https://github.com/0xProject/0x-monorepo","homepage":"","size":56028,"stargazers_count":790,"watchers_count":790,"language":"TypeScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":209,"mirror_url":null,"archived":false,"open_issues_count":47,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":209,"open_issues":47,"watchers":790,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/0xProject/0x-monorepo/pulls/1012"},"html":{"href":"https://github.com/0xProject/0x-monorepo/pull/1012"},"issue":{"href":"https://api.github.com/repos/0xProject/0x-monorepo/issues/1012"},"comments":{"href":"https://api.github.com/repos/0xProject/0x-monorepo/issues/1012/comments"},"review_comments":{"href":"https://api.github.com/repos/0xProject/0x-monorepo/pulls/1012/comments"},"review_comment":{"href":"https://api.github.com/repos/0xProject/0x-monorepo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/0xProject/0x-monorepo/pulls/1012/commits"},"statuses":{"href":"https://api.github.com/repos/0xProject/0x-monorepo/statuses/6c72d4f76643293d2caa155847a95dd4ea25a297"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"Recmo"}}