Skip to main content
3 of 3

You should use send instead of call, because token transfer does modify blockchain state:

// transfer 100 tokens form 0xD0A88... to 0x36c90...
contract.transfer.send(
  "0x36C90...", 
  100 * Math.pow (10, 18),
  {
    from: "0xD0A88..."
  }, 
  function(error, txHash) {
    console.log(txHash);
  });

Though, this will not work with Infura, because Infura does not have your private key. You will need to do contract.transfer.getData("0x36C90...", 100 * Math.pow (10, 18)) to get encoded transaction data, and then use this data to construct and sign raw transaction.

BTW, you use floating point arithmetic to calculate number of tokens to be transferred. This way you will loose precision. You should use BigNumber instead.