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

Cannot call transfer method of smart contract #31

Description

@frogg

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:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions