{"action":"created","issue":{"url":"https://api.github.com/repos/ethereum/web3.js/issues/182","labels_url":"https://api.github.com/repos/ethereum/web3.js/issues/182/labels{/name}","comments_url":"https://api.github.com/repos/ethereum/web3.js/issues/182/comments","events_url":"https://api.github.com/repos/ethereum/web3.js/issues/182/events","html_url":"https://github.com/ethereum/web3.js/issues/182","id":70532115,"number":182,"title":"JS ABI Issue","user":{"login":"joeykrug","id":5925937,"avatar_url":"https://avatars.githubusercontent.com/u/5925937?v=3","gravatar_id":"","url":"https://api.github.com/users/joeykrug","html_url":"https://github.com/joeykrug","followers_url":"https://api.github.com/users/joeykrug/followers","following_url":"https://api.github.com/users/joeykrug/following{/other_user}","gists_url":"https://api.github.com/users/joeykrug/gists{/gist_id}","starred_url":"https://api.github.com/users/joeykrug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joeykrug/subscriptions","organizations_url":"https://api.github.com/users/joeykrug/orgs","repos_url":"https://api.github.com/users/joeykrug/repos","events_url":"https://api.github.com/users/joeykrug/events{/privacy}","received_events_url":"https://api.github.com/users/joeykrug/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-04-23T22:49:35Z","updated_at":"2015-04-26T13:32:04Z","closed_at":null,"body":"Take the following contract for example:\r\n```js\r\ndef createMarket(events:arr): return(events[0]\r\n```\r\n\r\nIts address is ```bf1f9a04cb5c85e9538a6f0e6ba15c824808cfee```\r\nAnd its description is:\r\n```js\r\n[{ \"name\": \"createMarket(int256[])\", \"type\": \"function\", \"inputs\": [{ \"name\": \"events\", \"type\": \"int256[]\" }], \"outputs\": [{ \"name\": \"out\", \"type\": \"int256\" }] }]\r\n```\r\n\r\nIf called in the web3.js console, e.g. \r\n```js\r\n> contract.call({\"from\": eth.coinbase}).createMarket([-2333333333333333333333333333333333333333333333333332222222222233]).toNumber();```   it'll return ```-2.3333333333333333e+63\r\n```\r\nwhich is the correct value.\r\n\r\nNow if we use this contract:\r\n```js\r\ndef createMarket(branch, description:str, alpha, initialLiquidity, tradingFee, events:arr): return(events[0])\r\n```\r\nwith address `0xe95aa1829447058201872db6ae3f04c3785a05b0`\r\nAnd description:\r\n```js\r\n[{ \"name\": \"createMarket(int256,string,int256,int256,int256,int256[])\", \"type\": \"function\", \"inputs\": [{ \"name\": \"branch\", \"type\": \"int256\" }, { \"name\": \"description\", \"type\": \"bytes\" }, { \"name\": \"alpha\", \"type\": \"int256\" }, { \"name\": \"initialLiquidity\", \"type\": \"int256\" }, { \"name\": \"tradingFee\", \"type\": \"int256\" }, { \"name\": \"events\", \"type\": \"int256[]\" }], \"outputs\": [{ \"name\": \"out\", \"type\": \"int256\" }] }]\r\n```\r\n\r\nWe end up getting completely wrong responses: \r\n```js\r\n> contract.call({\"from\": eth.coinbase}).createMarket(2, \"ok\", 2, 2, 2, [444]).toNumber();\r\n0\r\n> contract.call({\"from\": eth.coinbase}).createMarket(2, \"ok\", 2, 2, 2, [-371]).toNumber();\r\n65535\r\n> contract.call({\"from\": eth.coinbase}).createMarket(2, \"ok\", 2, 2, 2, [371]).toNumber();\r\n0\r\n> contract.call({\"from\": eth.coinbase}).createMarket(2, \"ok\", 2, 2, 2, [-37117353667364131058659323780745282444029701754006041568106926382588839136039]).toNumber();\r\n44528\r\n> contract.call({\"from\": eth.coinbase}).createMarket(2, \"ok\", 2, 2, 2, [-4443434345]).toNumber();\r\n65535\r\n```\r\n\r\nEdit: now contract.foo().call() is returning \r\n```js\r\nerror: could not decode, json: cannot unmarshal array into Go value of type struct { From string; To string; Value interface {}; Gas interface {}; GasPrice interface {}; Data string }\r\n```"},"comment":{"url":"https://api.github.com/repos/ethereum/web3.js/issues/comments/96378648","html_url":"https://github.com/ethereum/web3.js/issues/182#issuecomment-96378648","issue_url":"https://api.github.com/repos/ethereum/web3.js/issues/182","id":96378648,"user":{"login":"chriseth","id":9073706,"avatar_url":"https://avatars.githubusercontent.com/u/9073706?v=3","gravatar_id":"","url":"https://api.github.com/users/chriseth","html_url":"https://github.com/chriseth","followers_url":"https://api.github.com/users/chriseth/followers","following_url":"https://api.github.com/users/chriseth/following{/other_user}","gists_url":"https://api.github.com/users/chriseth/gists{/gist_id}","starred_url":"https://api.github.com/users/chriseth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriseth/subscriptions","organizations_url":"https://api.github.com/users/chriseth/orgs","repos_url":"https://api.github.com/users/chriseth/repos","events_url":"https://api.github.com/users/chriseth/events{/privacy}","received_events_url":"https://api.github.com/users/chriseth/received_events","type":"User","site_admin":false},"created_at":"2015-04-26T13:32:04Z","updated_at":"2015-04-26T13:32:04Z","body":"The examples on the wiki page of the specification seem to contradict the specification itself.\r\nI hope that the new proposal does not need examples for clarification, only for illustration :-)"}}