Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.

Cannot call transfer method of smart contract #31

Open
frogg opened this issue Aug 1, 2018 · 0 comments
Open

Cannot call transfer method of smart contract #31

frogg opened this issue Aug 1, 2018 · 0 comments

Comments

@frogg
Copy link

frogg commented Aug 1, 2018

Issue Type

It's a bug and I am not sure how to fix it.

Description

I am using ethjs in a react project to interact with a smart contract.

What I do so far:

  • Accessing the address that the user is currently logged in with in meta mask ✅
window.web3.eth.getAccounts(function(err,accounts) {
	resolve(accounts[0]);
});
  • Reading values from the Smart Contract such as the Symbol, Currency Name, Balance for Address ✅
const OASContract = eth.contract(abi).at('0x559623d3660bbae4ee3c90c6ad600d54a520b792');
OASContract.symbol().then(function(result) {
	resolve(result["0"])
});
OASContract.balanceOf(address).then(function(result) {
	resolve(result.balance)
});
OASContract.name().then(function(result) {
	resolve(result["0"])
});

This all works. But now I want to call the transfer method of the SC and this is where I get lost.

Steps to reproduce

OASContract.transferFrom(_from, _to, amount, {from: _from, gas:55000})

Now, this does not work. I get some weird messages in the console:

XML Parsing Error: no root element found
Location: https://ropsten.infura.io/C2D8VJd9N6XXXXXXXXX
Line Number 1, Column 1:
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant