Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Parity does not work with contracts: #885

Closed
tymat opened this issue Apr 4, 2016 · 0 comments · Fixed by #892
Closed

Parity does not work with contracts: #885

tymat opened this issue Apr 4, 2016 · 0 comments · Fixed by #892
Assignees
Labels
F2-bug 🐞 The client fails to follow expected behavior.

Comments

@tymat
Copy link

tymat commented Apr 4, 2016

The following works on geth/eth but not with parity:

var abiString = '[  \n  {  \n    "constant":false,\n    "inputs":[  \n      {  \n        "name":"_addr",\n        "type":"address"\n      },\n      {  \n        "name":"_val",\n        "type":"uint256"\n      }\n    ],\n    "name":"approve",\n    "outputs":[  \n      {  \n        "name":"",\n        "type":"bool"\n      }\n    ],\n    "type":"function"\n  },\n  {  \n    "constant":true,\n    "inputs":[  \n\n    ],\n    "name":"totalSupply",\n    "outputs":[  \n      {  \n        "name":"",\n        "type":"uint256"\n      }\n    ],\n    "type":"function"\n  },\n  {  \n    "constant":false,\n    "inputs":[  \n      {  \n        "name":"_from",\n        "type":"address"\n      },\n      {  \n        "name":"_to",\n        "type":"address"\n      },\n      {  \n        "name":"_value",\n        "type":"uint256"\n      }\n    ],\n    "name":"transferFrom",\n    "outputs":[  \n      {  \n        "name":"",\n        "type":"bool"\n      }\n    ],\n    "type":"function"\n  },\n  {  \n    "constant":false,\n    "inputs":[  \n\n    ],\n    "name":"txFeeWallet",\n    "outputs":[  \n      {  \n        "name":"",\n        "type":"address"\n      }\n    ],\n    "type":"function"\n  },\n  {  \n    "constant":false,\n    "inputs":[  \n\n    ],\n    "name":"accountingWallet",\n    "outputs":[  \n      {  \n        "name":"",\n        "type":"address"\n      }\n    ],\n    "type":"function"\n  },\n  {  \n    "constant":false,\n    "inputs":[  \n\n    ],\n    "name":"storageRate",\n    "outputs":[  \n      {  \n        "name":"",\n        "type":"uint256"\n      }\n    ],\n    "type":"function"\n  },\n  {  \n    "constant":false,\n    "inputs":[  \n      {  \n        "name":"_address",\n        "type":"address"\n      }\n    ],\n    "name":"balanceOf",\n    "outputs":[  \n      {  \n        "name":"",\n        "type":"uint256"\n      }\n    ],\n    "type":"function"\n  },\n  {  \n    "constant":false,\n    "inputs":[  \n      {  \n        "name":"_to",\n        "type":"address"\n      },\n      {  \n        "name":"_value",\n        "type":"uint256"\n      }\n    ],\n    "name":"transfer",\n    "outputs":[  \n      {  \n        "name":"",\n        "type":"bool"\n      }\n    ],\n    "type":"function"\n  },\n  {  \n    "constant":false,\n    "inputs":[  \n\n    ],\n    "name":"txFee",\n    "outputs":[  \n      {  \n        "name":"",\n        "type":"uint256"\n      }\n    ],\n    "type":"function"\n  },\n  {  \n    "constant":false,\n    "inputs":[  \n\n    ],\n    "name":"getBase",\n    "outputs":[  \n      {  \n        "name":"",\n        "type":"uint256"\n      }\n    ],\n    "type":"function"\n  },\n  {  \n    "constant":true,\n    "inputs":[  \n      {  \n        "name":"_owner",\n        "type":"address"\n      },\n      {  \n        "name":"_spender",\n        "type":"address"\n      }\n    ],\n    "name":"allowance",\n    "outputs":[  \n      {  \n        "name":"",\n        "type":"uint256"\n      }\n    ],\n    "type":"function"\n  },\n  {  \n    "constant":false,\n    "inputs":[  \n      {  \n        "name":"_value",\n        "type":"uint256"\n      },\n      {  \n        "name":"_user",\n        "type":"address"\n      }\n    ],\n    "name":"calculateTxFee",\n    "outputs":[  \n      {  \n        "name":"",\n        "type":"uint256"\n      }\n    ],\n    "type":"function"\n  },\n  {  \n    "inputs":[  \n      {  \n        "name":"_conf",\n        "type":"address"\n      }\n    ],\n    "type":"constructor"\n  }\n]\n';
var abi = JSON.parse(abiString);
var GoldTokens = web3.eth.contract(abi);
var goldTokens = GoldTokens.at("0x55b9a11c2e8351b4ffc7b11561148bfac9977855");
console.log(goldTokens.balanceOf.call("0x9ac937835f6a06657441ac77788b72e3bddf2ae1"));
'0'

The following should output a non-zero value.

@gavofyork gavofyork added the F2-bug 🐞 The client fails to follow expected behavior. label Apr 6, 2016
@arkpar arkpar assigned arkpar and unassigned debris Apr 6, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
F2-bug 🐞 The client fails to follow expected behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants