0

I deployed Test Token(Copy of LQRD) on Fantom test network.
I sent signed transaction From A account To B account using A private key.
The transaction was succeeded.
But token was not transfered from A to B.

const nonce = web3.eth.getTransactionCount('A address','pending');
const Contract = new web3.eth.Contract(Abi, Addresse);
const encodedABI = Contract.methods.transfer('B address', 100000).encodeABI();
var rawTransaction = {"to": 'B addresss', "gas": 100000, "nonce": nonce ,"data": encodedABI}; 
const signedTx = await web3.eth.accounts.signTransaction(rawTransaction, 'Private key');
console.log(signedTx.rawTransaction);
web3.eth.sendSignedTransaction(signedTx.rawTransaction, function(error, hash) {
  if(!error) console.log(hash);
  else console.log(error);
});

1 Answer 1

0

It would have been great if you dropped the transaction hash.

What I can find wrong with your rawTransaction object is that, you are specifying a to key.

This isn't necessary as you encodeABI would direct the call to the right address, and that aside, to should point to the token address and not to the B address.

Your transfer call is likely being directed to B address rather than the token address.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.