{"action":"created","issue":{"url":"https://api.github.com/repos/ethers-io/ethers.js/issues/178","repository_url":"https://api.github.com/repos/ethers-io/ethers.js","labels_url":"https://api.github.com/repos/ethers-io/ethers.js/issues/178/labels{/name}","comments_url":"https://api.github.com/repos/ethers-io/ethers.js/issues/178/comments","events_url":"https://api.github.com/repos/ethers-io/ethers.js/issues/178/events","html_url":"https://github.com/ethers-io/ethers.js/issues/178","id":323653922,"number":178,"title":"Can't call contract with uint256 as a parameter","user":{"login":"Kastamarov","id":15988023,"avatar_url":"https://avatars1.githubusercontent.com/u/15988023?v=4","gravatar_id":"","url":"https://api.github.com/users/Kastamarov","html_url":"https://github.com/Kastamarov","followers_url":"https://api.github.com/users/Kastamarov/followers","following_url":"https://api.github.com/users/Kastamarov/following{/other_user}","gists_url":"https://api.github.com/users/Kastamarov/gists{/gist_id}","starred_url":"https://api.github.com/users/Kastamarov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kastamarov/subscriptions","organizations_url":"https://api.github.com/users/Kastamarov/orgs","repos_url":"https://api.github.com/users/Kastamarov/repos","events_url":"https://api.github.com/users/Kastamarov/events{/privacy}","received_events_url":"https://api.github.com/users/Kastamarov/received_events","type":"User","site_admin":false},"labels":[{"id":409075433,"url":"https://api.github.com/repos/ethers-io/ethers.js/labels/investigate","name":"investigate","color":"e99695","default":false},{"id":858787404,"url":"https://api.github.com/repos/ethers-io/ethers.js/labels/on-deck","name":"on-deck","color":"1bd691","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-05-16T14:45:06Z","updated_at":"2018-05-16T21:31:05Z","closed_at":null,"author_association":"NONE","body":"I have a contract with this part off ABI: \r\n```\r\n[\r\n{\r\n      \"constant\": true,\r\n      \"inputs\": [\r\n        {\r\n          \"name\": \"\",\r\n          \"type\": \"uint256\"\r\n        }\r\n      ],\r\n      \"name\": \"btcTransactions\",\r\n      \"outputs\": [\r\n        {\r\n          \"name\": \"\",\r\n          \"type\": \"bool\"\r\n        }\r\n      ],\r\n      \"payable\": false,\r\n      \"stateMutability\": \"view\",\r\n      \"type\": \"function\"\r\n    }\r\n] \r\n``` \r\nThe contract can be found in the rinkeby test network on the address 0xf941b2f00aedd0bd8b98642a6e8232ccf02efd50.\r\n\r\n```\r\nUsing the truffle I can easy call this function with a string or a BigNumber as a parameter, for example:\r\n(rinkeby)>ICO.at(\"0xf941b2f00aedd0bd8b98642a6e8232ccf02efd50\").btcTransactions(\"0x9d8336ca0217be46aba738cf09c429086398f0432420c8fe391a9d2ee18319a8\");\r\nfalse\r\n```\r\n\r\n```\r\n(rinkeby)>ICO.at(\"0xf941b2f00aedd0bd8b98642a6e8232ccf02efd50\").btcTransactions(web3.toBigNumber(\"0x9d8336ca0217be46aba738cf09c429086398f0432420c8fe391a9d2ee18319a8\"));\r\nfalse\r\n```\r\n\r\nBut when i try to do the same thing using ethers.js I get the error:\r\n```\r\nError: call exception (address=\"0xf941b2f00aedd0bd8b98642a6e8232ccf02efd50\", method=\"btcTransactions(uint256)\", value=[{\"_bn\":\"9d8336ca0217be46aba738cf09c429086398f0432420c8fe391a9d2ee18319a8\"}])\r\nat Object.throwError (node_modules/ethers/utils/errors.js:74:17)\r\n```\r\n\r\nI've tried different ways to resolve this: \r\n- contract.btcTransactions(\"hash\");\r\n- contract.btcTransactions(toUtf8Bytes(\"hash\"));\r\n- contract.btcTransactions(bigNumberify(\"hash\"));\r\n- contract.btcTransactions(bigNumberify(toUtf8Bytes(\"hash\"))).\r\n\r\nbut it didn't help.\r\n\r\nThanks.\r\n"},"comment":{"url":"https://api.github.com/repos/ethers-io/ethers.js/issues/comments/389672328","html_url":"https://github.com/ethers-io/ethers.js/issues/178#issuecomment-389672328","issue_url":"https://api.github.com/repos/ethers-io/ethers.js/issues/178","id":389672328,"user":{"login":"akucheruk-vareger","id":31038795,"avatar_url":"https://avatars2.githubusercontent.com/u/31038795?v=4","gravatar_id":"","url":"https://api.github.com/users/akucheruk-vareger","html_url":"https://github.com/akucheruk-vareger","followers_url":"https://api.github.com/users/akucheruk-vareger/followers","following_url":"https://api.github.com/users/akucheruk-vareger/following{/other_user}","gists_url":"https://api.github.com/users/akucheruk-vareger/gists{/gist_id}","starred_url":"https://api.github.com/users/akucheruk-vareger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akucheruk-vareger/subscriptions","organizations_url":"https://api.github.com/users/akucheruk-vareger/orgs","repos_url":"https://api.github.com/users/akucheruk-vareger/repos","events_url":"https://api.github.com/users/akucheruk-vareger/events{/privacy}","received_events_url":"https://api.github.com/users/akucheruk-vareger/received_events","type":"User","site_admin":false},"created_at":"2018-05-16T21:31:05Z","updated_at":"2018-05-16T21:31:05Z","author_association":"NONE","body":"I feel you are deadly right. \r\nWe have a number of deployments for this contract and accidentally can use a one without this mapping, but trust truffle when check this issue. \r\nI’ll try tomorrow when get to my laptop but I think you are right, especially if there are no signature in the bytecode \r\nwhy I didn’t try to look there... arrgh :(\r\nSorry for that and many thanks!"}}
{"actor":{"display_login":"akucheruk-vareger"}}