{"action":"opened","issue":{"url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-solidity/issues/1576","repository_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-solidity","labels_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-solidity/issues/1576/labels{/name}","comments_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-solidity/issues/1576/comments","events_url":"https://api.github.com/repos/OpenZeppelin/openzeppelin-solidity/issues/1576/events","html_url":"https://github.com/OpenZeppelin/openzeppelin-solidity/issues/1576","id":394551196,"node_id":"MDU6SXNzdWUzOTQ1NTExOTY=","number":1576,"title":"SafeMath can no longer be used as a library for uints smaller than 256","user":{"login":"BrendanChou","id":3680392,"node_id":"MDQ6VXNlcjM2ODAzOTI=","avatar_url":"https://avatars0.githubusercontent.com/u/3680392?v=4","gravatar_id":"","url":"https://api.github.com/users/BrendanChou","html_url":"https://github.com/BrendanChou","followers_url":"https://api.github.com/users/BrendanChou/followers","following_url":"https://api.github.com/users/BrendanChou/following{/other_user}","gists_url":"https://api.github.com/users/BrendanChou/gists{/gist_id}","starred_url":"https://api.github.com/users/BrendanChou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrendanChou/subscriptions","organizations_url":"https://api.github.com/users/BrendanChou/orgs","repos_url":"https://api.github.com/users/BrendanChou/repos","events_url":"https://api.github.com/users/BrendanChou/events{/privacy}","received_events_url":"https://api.github.com/users/BrendanChou/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-28T05:31:14Z","updated_at":"2018-12-28T05:31:14Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"<!-- Briefly describe the issue you're experiencing. Tell us what you were trying to do and what happened instead. -->\r\n\r\nCan no longer use SafeMath as an in-line library for unsigned integers smaller than 256. For example:\r\n\r\n<!-- Remember, this is not a place to ask for help debugging code. For that, we welcome you in the OpenZeppelin Slack channel: https://slack.openzeppelin.org/. -->\r\n\r\n**💻 Environment**\r\n\r\n<!-- Tell us what version of OpenZeppelin you're using, and how you're using it: Truffle, Remix, etc. -->\r\n\r\nTruffle 5 and OpenZeppelin 2.1 although I suspect this is also the case for OpenZeppelin 2.0\r\n\r\n**📝 Details**\r\n\r\nThis is because there are new functions for signed integers in SafeMath. Recommend splitting into two different files so that both unsigned ints and signed ints of less than 256 bits can be used without first casting to uint256 or int256, which can cause bugs in the code using SafeMath.\r\n\r\n<!-- Describe the problem you have been experiencing in more detail. Include as much information as you think is relevant. Keep in mind that transactions can fail for many reasons; context is key here. -->\r\n\r\n**🔢 Code to reproduce bug**\r\n```\r\nusing SafeMath for uint128;\r\nfunction failMath() public pure {\r\n    uint128 a = 1;\r\n    a.add(1);\r\n}\r\n```\r\nresults in the error:\r\n`Member \"add\" not unique after argument-dependent lookup in type(library SafeMath).`\r\n\r\n<!-- We will be able to better help if you provide a minimal example that triggers the bug. -->\r\n"}}
{"actor":{"display_login":"BrendanChou"}}