{"action":"created","issue":{"url":"https://api.github.com/repos/ethers-io/ethers.js/issues/200","repository_url":"https://api.github.com/repos/ethers-io/ethers.js","labels_url":"https://api.github.com/repos/ethers-io/ethers.js/issues/200/labels{/name}","comments_url":"https://api.github.com/repos/ethers-io/ethers.js/issues/200/comments","events_url":"https://api.github.com/repos/ethers-io/ethers.js/issues/200/events","html_url":"https://github.com/ethers-io/ethers.js/issues/200","id":331951450,"node_id":"MDU6SXNzdWUzMzE5NTE0NTA=","number":200,"title":"Contract call returns weird data","user":{"login":"The-3D","id":37953689,"node_id":"MDQ6VXNlcjM3OTUzNjg5","avatar_url":"https://avatars3.githubusercontent.com/u/37953689?v=4","gravatar_id":"","url":"https://api.github.com/users/The-3D","html_url":"https://github.com/The-3D","followers_url":"https://api.github.com/users/The-3D/followers","following_url":"https://api.github.com/users/The-3D/following{/other_user}","gists_url":"https://api.github.com/users/The-3D/gists{/gist_id}","starred_url":"https://api.github.com/users/The-3D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/The-3D/subscriptions","organizations_url":"https://api.github.com/users/The-3D/orgs","repos_url":"https://api.github.com/users/The-3D/repos","events_url":"https://api.github.com/users/The-3D/events{/privacy}","received_events_url":"https://api.github.com/users/The-3D/received_events","type":"User","site_admin":false},"labels":[{"id":409075429,"node_id":"MDU6TGFiZWw0MDkwNzU0Mjk=","url":"https://api.github.com/repos/ethers-io/ethers.js/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"closed","locked":false,"assignee":{"login":"ricmoo","id":975687,"node_id":"MDQ6VXNlcjk3NTY4Nw==","avatar_url":"https://avatars3.githubusercontent.com/u/975687?v=4","gravatar_id":"","url":"https://api.github.com/users/ricmoo","html_url":"https://github.com/ricmoo","followers_url":"https://api.github.com/users/ricmoo/followers","following_url":"https://api.github.com/users/ricmoo/following{/other_user}","gists_url":"https://api.github.com/users/ricmoo/gists{/gist_id}","starred_url":"https://api.github.com/users/ricmoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ricmoo/subscriptions","organizations_url":"https://api.github.com/users/ricmoo/orgs","repos_url":"https://api.github.com/users/ricmoo/repos","events_url":"https://api.github.com/users/ricmoo/events{/privacy}","received_events_url":"https://api.github.com/users/ricmoo/received_events","type":"User","site_admin":false},"assignees":[{"login":"ricmoo","id":975687,"node_id":"MDQ6VXNlcjk3NTY4Nw==","avatar_url":"https://avatars3.githubusercontent.com/u/975687?v=4","gravatar_id":"","url":"https://api.github.com/users/ricmoo","html_url":"https://github.com/ricmoo","followers_url":"https://api.github.com/users/ricmoo/followers","following_url":"https://api.github.com/users/ricmoo/following{/other_user}","gists_url":"https://api.github.com/users/ricmoo/gists{/gist_id}","starred_url":"https://api.github.com/users/ricmoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ricmoo/subscriptions","organizations_url":"https://api.github.com/users/ricmoo/orgs","repos_url":"https://api.github.com/users/ricmoo/repos","events_url":"https://api.github.com/users/ricmoo/events{/privacy}","received_events_url":"https://api.github.com/users/ricmoo/received_events","type":"User","site_admin":false}],"milestone":null,"comments":6,"created_at":"2018-06-13T11:20:27Z","updated_at":"2018-06-21T02:46:44Z","closed_at":"2018-06-21T02:46:44Z","author_association":"NONE","body":"Hello, i'm having a weird problem with ethers.js. My goal is to ditch web3 completely, but right now i can't because of this. here is an example code:\r\n\r\n```\r\nvar Web3 = require(\"web3\");\r\n\r\nvar web3Provider = new Web3.providers.HttpProvider(configParams.INFURA_URL_MAIN);\r\n\r\nvar web3 = new Web3(web3Provider);\r\n\r\n\r\nvar provider =  new ethers.providers.InfuraProvider(\"homestead\");\r\n\r\n\r\nvar getDataWeb3 = async() =>{\r\n\r\n  let contract = await (new web3.eth.Contract(configParams.LEDGER_ABI,  configParams.LEDGER_ADDRESS_MAIN));\r\n  \r\n let list= await contract.methods.filterByState(3).call();\r\n\r\n console.log(list);\r\n  \r\n  list= await contract.methods.filterByState(4).call();\r\n \r\n console.log(list);\r\n \r\n  list = await contract.methods.filterByState(5).call();\r\n \r\n  console.log(list);\r\n\r\n};\r\n\r\nvar getDataEthers = async() => {\r\n\r\n      \r\n\r\nlet contract = await (new ethers.Contract(  configParams.LEDGER_ADDRESS_MAIN,configParams.LEDGER_ABI,provider));\r\n\r\n let list= await contract.filterByState(3);\r\n\r\nconsole.log(list);\r\n \r\n list= await contract.filterByState(5);\r\n\r\nconsole.log(list);\r\n list= await contract.filterByState(7);\r\n\r\nconsole.log(list);\r\n \r\n};\r\n\r\nvar run = async() => {\r\n\r\n  console.log(\"Using web3: \");\r\n  \r\n await getDataWeb3();\r\n\r\n  console.log(\"Using Ethers: \");\r\n  \r\n  await getDataEthers();\r\n  \r\n\r\n\r\n};\r\n\r\nrun();\r\n\r\n```\r\n\r\nif i run this code, the Web3 method prints the data correctly (the returned data of filterByState is a list of addresses). The ethers method tho prints correctly only the first call output, while the result of the other two is the value 0x0000000000000000000000000000000000000020. This is an example output:\r\n\r\n```\r\nUsing ethers\r\n[ '0x7E1c94a5eDbfB7A8b5956f9d441fc049057222c2',\r\n  '0xF307C7888Cf8C4b9ec2FBAeD7b10e0c336Ac9A3F',\r\n  _addresses: '0x7E1c94a5eDbfB7A8b5956f9d441fc049057222c2' ]\r\n0x0000000000000000000000000000000000000020\r\n0x0000000000000000000000000000000000000020\r\n```\r\n\r\ndon't honestly know what to do, code looks so simple i can't find any mistake. Tried other providers and got the same result, even using the Web3 provider. Any thoughts?\r\n"},"comment":{"url":"https://api.github.com/repos/ethers-io/ethers.js/issues/comments/398959011","html_url":"https://github.com/ethers-io/ethers.js/issues/200#issuecomment-398959011","issue_url":"https://api.github.com/repos/ethers-io/ethers.js/issues/200","id":398959011,"node_id":"MDEyOklzc3VlQ29tbWVudDM5ODk1OTAxMQ==","user":{"login":"ricmoo","id":975687,"node_id":"MDQ6VXNlcjk3NTY4Nw==","avatar_url":"https://avatars3.githubusercontent.com/u/975687?v=4","gravatar_id":"","url":"https://api.github.com/users/ricmoo","html_url":"https://github.com/ricmoo","followers_url":"https://api.github.com/users/ricmoo/followers","following_url":"https://api.github.com/users/ricmoo/following{/other_user}","gists_url":"https://api.github.com/users/ricmoo/gists{/gist_id}","starred_url":"https://api.github.com/users/ricmoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ricmoo/subscriptions","organizations_url":"https://api.github.com/users/ricmoo/orgs","repos_url":"https://api.github.com/users/ricmoo/repos","events_url":"https://api.github.com/users/ricmoo/events{/privacy}","received_events_url":"https://api.github.com/users/ricmoo/received_events","type":"User","site_admin":false},"created_at":"2018-06-21T02:46:44Z","updated_at":"2018-06-21T02:46:44Z","author_association":"MEMBER","body":"Awesome! Glad hear it.\r\n\r\nI've just pushed 3.0.24, which also gets rid of that stray weird value that was showing up."}}
{"actor":{"display_login":"ricmoo"}}