web3.js icon indicating copy to clipboard operation
web3.js copied to clipboard

contract method call

Open lakshmankashyap opened this issue 8 years ago • 4 comments

but how can call contract method in web3 beta version always show error unknown account

not work unlock account here any solutions

lakshmankashyap avatar Mar 06 '18 19:03 lakshmankashyap

try this brefore you call conract method web3.personal.unlockAccount(AccountAddress, Password)

theWangs avatar Mar 07 '18 02:03 theWangs

@lakshmankashyap - you are going to have to provide more context for anyone to help you. Can you show us some example code that you're having trouble with?

gburtini avatar Mar 13 '18 16:03 gburtini

@gburtini i have the same error when call contract method in web3, the code is

let options = { from: from, gasPrice: self.web3.utils.toHex(results.gasPrice), gas: self.web3.utils.toHex(800000) } const erc20Contract = new self.web3.eth.Contract(erc20Abi, contractaddr, options) erc20Contract.methods.transferFrom(to, from, 1).send({from: from}, function(err, result) { if (err) return reject(err) return resolve(result) })

the error is ' Error: Returned error: unknown account at Object.ErrorResponse (errors.js?aaea:29) at eval (index.js?abfa:137) at XMLHttpRequest.request.onreadystatechange (index.js?9620:77)'

how to solve it ? thank you

xntop avatar Mar 19 '18 02:03 xntop

Please ask this question on https://ethereum.stackexchange.com/

nivida avatar Aug 09 '18 16:08 nivida